Skip to content
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

In there any way to use this after RNW removed className? #37

Open
kuasha420 opened this issue Jan 10, 2021 · 8 comments
Open

In there any way to use this after RNW removed className? #37

kuasha420 opened this issue Jan 10, 2021 · 8 comments

Comments

@kuasha420
Copy link

I couldn't find anything to explain that.

@kristerkari
Copy link
Owner

I think that with RNW the only possibility is to use something like patch-package to patch the library to bring className support back.

@kristerkari
Copy link
Owner

I'm using a patch in the example app that brings back the support for react-native-web className prop:
https://github.com/kristerkari/react-native-css-modules-with-typescript-example/blob/master/patches/react-native-web%2B0.12.3.patch

@aaronyeeio
Copy link

I'm using a patch in the example app that brings back the support for react-native-web className prop: https://github.com/kristerkari/react-native-css-modules-with-typescript-example/blob/master/patches/react-native-web%2B0.12.3.patch

Hey bro, I was going through some cool css solutions and I still believe that a powerful css-in-file could have the best css feature coverage so that I can utilize expo to fully work on Web without losing any consistency across all platforms.

I appreciate your amazing work on the whole solution!

However, I got quite confused when adding the support to RNW. Is there any possibility that you could fork the RNW and the community can help you to maintain the className support and sync with the upstream?

@aaronyeeio
Copy link

I created a fork and modified the package to make it support className.

https://github.com/0xGravityLabs/react-native-web

https://www.npmjs.com/package/@gravitylabs/react-native-web

Feel free to use it.

@kristerkari
Copy link
Owner

Is there any possibility that you could fork the RNW and the community can help you to maintain the className support and sync with the upstream?

I don't want to start maintaining a fork of RNW, so that's why I have not done it.

I created a fork and modified the package to make it support className.

Nice! Do you also have plans to keep on updating the fork with changes from RNW? Your fork could be added to the README if that's the case.

@aaronyeeio
Copy link

Is there any possibility that you could fork the RNW and the community can help you to maintain the className support and sync with the upstream?

I don't want to start maintaining a fork of RNW, so that's why I have not done it.

I created a fork and modified the package to make it support className.

Nice! Do you also have plans to keep on updating the fork with changes from RNW? Your fork could be added to the README if that's the case.

Yes! I think the most maintaining jobs to do are simply just syncing with the upstream as I didn't change much of the code. I'll try to keep it update-to-date at every major release of RNW.

@JoeBoulton
Copy link

How do I get this to work in my project? When I uninstall react-native-web and install your fork, expo says it can't find react-native-web. Any tips?

@kristerkari
Copy link
Owner

@JoeBoulton I have not tested, so I'm not sure if it works, but could that be possible with the alias feature of Yarn or npm?

So if you tried to use react-native-web as an alias for @gravitylabs/react-native-web.

See: https://www.nieknijland.nl/blog/use-multiple-versions-of-an-npm-package-at-the-same-time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants