-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support react-native #382
base: main
Are you sure you want to change the base?
feat: support react-native #382
Conversation
df24a9f
to
1eda12a
Compare
Thanks for this @igorwessel 🚀 This will help us a lot |
Nice @igorwessel! 😄 |
I prefer Maybe there is a way to trim this down and get rid of the dependency for react-native itself? |
We can maybe install as a dependency in
The react-native package is in the development dependencies, without it there is no way to perform the tests |
I realized that a lot of the code is duplication that is not worth it to move in new package. I made some changes in the functions that create the styled, xstyled, css to receive as parameters the dependencies of the styled, css function that will be used. We were able to have these functions with greater flexibility, which allows us to reuse them both for native/web. I have separated the responsibilities of defining an interface into new functions so that we can use the functions that create styled,xstyled without an interface and then define from those returned values. e.g: const { scStyled, styled, xstyled } = createStyled(scStyled, css, generator)
Object.keys(scStyled).forEach(key => styled[key] = styled(key)) Which allows us to reuse them both for native/web. Finally I created a package inside styled-components so we can use We can still have them as a separate package, and just put it as a styled-components dependency. |
🚀 |
@gregberge When you have time, can you take a look? |
@igorwessel CI fails, could you try to fix it? |
@gregberge I needed to update the react-simple-editor dependency to @0.11.3 as it doesn't exactly include react@^16 peer-deps. So the NPM can resolve the dependencies without needing to set the flag |
@igorwessel after the doc, I could merge it. |
Thanks @igorwessel can you rebase please? |
2830fed
to
df438d4
Compare
@gregberge Sorry for the delay, I had some problems but the rebase is done. 👍 |
@gregberge Hey Greg, how you doing? Have a any expectation to includes this support to the RN? It's will be help us a lot. |
@igorwessel can you rebase it again? It's a nice feature and an awesome improvement for this library. |
Separating the responsibilities of defining an interface into functions.
df438d4
to
cb0162f
Compare
@thiagog3 done! 😄 |
@probablyup @gregberge Is it ok for merge? |
@gregberge 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏 |
Will review this weekend :) |
Any progress here? 👀 Is there something similar to xstyled out there (that is not tailwind) that supports also React Native? |
Summary
Hello guys! basically I'm trying to finalize a PR that was adding support for react-native.
Can find out a little more about it here: #273, thanks @diegotsi
My idea is basically the same as this PR except that I'll be adding the default use without utility props and the x function with utility props.
Test plan
Working with the latest react-native template: