Replies: 2 comments
-
Seems cool |
Beta Was this translation helpful? Give feedback.
0 replies
-
i understand the desire for that type of api, and some folks might really like that. looks cool. you might want to check out NativeWind, i think they're already doing a lot of that, (i believe using twrnc under the hood). this isn't something i ever have plans on integrating into the core library, mostly because of personal preference, which i describe here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What we may concern
I think people prefer to use
className="some-tw-style"
which is a more handy way instead ofstyles={tw`twsome-tw-style`}
.Also, putting styles outside of the components should be able to optimize performance of the render process.
Solution
So, I experimentally created a babel plugin to transform "className" attributes to the twrnc styles, which may enhance the DX when using twrnc.
Can somebody try out my package and leave some comment?
https://github.com/makaronma/babel-plugin-twrnc-extract
Below is how it works.
In
Out
Beta Was this translation helpful? Give feedback.
All reactions