briskml/brisk

Improve configureInstance stage on the native components

rauanmayemir opened this issue · 0 comments

On our native components, most of the time configureInstance function consists of repetitive code that just sets style on the underlying host element.

We should think of a way to streamline it to be both less boilerplate-y and adjustable at the same time. By adjustable I mean that some of the style attributes could be set differently, but we could hide it under protocols on Obj-C side, I guess. For instance, while on <view> padding is solved by positioning children, on <text> it's set directly on the host element.

As for less boilerplate'y, there also has to be a way to memoize the attribute values as to avoid setting them on every change.