astroturf icon indicating copy to clipboard operation
astroturf copied to clipboard

React Native support

Open ai opened this issue 6 years ago • 5 comments

One of the biggest reason to use styled-components is RN support.

It definitely, should be some CSS→RN loader for webpack. We need only show some example in the docs.

ai avatar Oct 04 '18 20:10 ai

what would this look like for RN, they don't have stylesheets right? we'd need to turn the extracted style into something they can use...i'm super unfamiliar with RN :P

jquense avatar Oct 04 '18 23:10 jquense

Me too :(.

Seems like they need inline styled or something similar.

I don’t suggest to have first-class support for RN. Just any snippet in docs for marketing purposes.

ai avatar Oct 04 '18 23:10 ai

looks like SC already solved this, so we just need to add a RN entry that uses https://github.com/styled-components/css-to-react-native

I wonder if that would be a good idea tho, it would be all at runtime, which is fine for RN but a little "off brand" so to speak for us

jquense avatar Oct 05 '18 14:10 jquense

right, i don't really see the point...

taion avatar Oct 05 '18 14:10 taion

I mean it is some amount of work, we can convert to an object before hand reducing the runtime cost of something like this, so it would be an improvement runtime-wise over SC. The main benefit tho i'd see is potential sharing? Or rather not having to switch abstractions/packages if you want to use a SC style api in both. However, most of our value as an abstraction is derived from the underlying preprocessor which you'd lose maybe here.

I have no idea what the RN build step is as well...is it even possible to preprocess the file?

jquense avatar Oct 05 '18 14:10 jquense