You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
agreed. i'm not sure why i can't access them on styles.someGlobalClass just like local ones. Without this, the result is using multiple paradigms to access classes in your React components:
While that's not horrible, what is though is if you're using React Native Web and you expect all your styles on an importable styles object because you can't provide a className prop. If globals were properly assigned to the exported styles object you could simply use different styles between a React Native project and a React Native Web Project, while keeping the components the same.
That said, you also have to do the following thing I do so you have a View component that shares the same interface on both web and native:
I.e. you don't use the standard RNW View component (which I've found to be sub-par because it inlines all css and restricts you just to the native css features supported by native). Instead, you roll your own that accepts class strings (possibly within an array) and if it's a string moves it to the className prop or if it's an object treats it as an inline style.
TL;DR: it doesn't seem like it would hurt any backwards compatibility to just export globals as well. If apps aren't using them, nothing changes for them. It's just unused keys on the styles object. For people that were hoping to use them, it's a blessing and basically expected.
I've noticed that
:global
classes are not exported when we require the CSS file. Is there a way/an option to allow global exports?Thanks
The text was updated successfully, but these errors were encountered: