Replies: 6 comments 8 replies
-
Same feeling @MoOx, also since using reanimated2 I use array even more. I think this would be a net improvement. There might be a small performance regression when using a an array of 1 vs a single style, but probably diminishable. |
Beta Was this translation helpful? Give feedback.
-
Same for me, I'll not be against this. But what about |
Beta Was this translation helpful? Give feedback.
-
I also would not be against this. Should be an easy refactor on the existing codebase. |
Beta Was this translation helpful? Give feedback.
-
Since time is limited, I have a simple solution (temporary) for us to try this at a large scale before pushing this as the main method: I was thinking we could add an alternate Style module (eg: Style2 or AStyle or a better (but short) name) to try this. Obviously if we keep Style that would means that there is at some point a weird magic trick to make them coexist but maybe it worth a try? Any thoughts? |
Beta Was this translation helpful? Give feedback.
-
Personally, I strongly prefer the way it is currently implemented. I just checked one of our projects and, out of 320 usages of
Also, usage with |
Beta Was this translation helpful? Give feedback.
-
Interesting stuff are in this PR: we tried but there is some complications: runtime & futur proof issues? @Freddy03h you mentioned that RNW could go back to num ids. But they just changed in 0.18 https://github.com/necolas/react-native-web/releases/tag/0.18.0 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
At first, when we revisited bs-react-native, we had for style
Recently, since array usage has been promoted in favour of list (we made this a breaking change in one of the last major release), so we now only have single style or array of style.
I find myself using array of style more than half of the time (because I use a combination of static styles and dynamic styles (hello dark mode).
I would be interested to know about the community practise because I am thinking
"what if style prop only accept array of style?"
Currently we need to write:
<Text style={style}
<Text style={array([style, style1])}
or<Text style={Style.array([style, style1])}
(depending on opened modules)If we change this, we would just have to type
<Text style={[style]}
<Text style={[style, style2]}
That would be obviously a breaking change, but should be easy to change.
Thoughts? poke @jfrolich @cknitt @sgny @idkjs @Freddy03h @gedeagas @celsobonutti (and anyone who wants to give their feedback on this idea)
Beta Was this translation helpful? Give feedback.
All reactions