-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Support React Native Web #316
Support React Native Web #316
Comments
Hi! No, there is currently no way to change the config, as it is preconfigured. I think we'd like to support |
@gaearon I confirm it works just adding this line https://github.com/grigio/react-native-plus-web-boilerplate/blob/master/config/webpack.config.dev.js#L34 There are some warnings because of necolas/react-native-web#178 |
Why does it need a hook into webpack, as opposed to just importing it and using it like usual? |
I think what’s happening is this project wants to “rewrite” existing |
Yes aliasing |
I googled "react native web" and found at least three projects doing this (each of them wants to be the resolve target of |
Yes but the main ones are |
how to use less-loader to webpack config with react-scripts command ? |
You currently can't. We don't officially endorse any compile-to-CSS languages. You can, however, use the regular command line utilities to compile Less onto CSS, and import that CSS. |
As for the issue I'm going to close because the community seems fragmented. If there is a clear winner in that space, and other projects join efforts, I'll be happy to reconsider. |
Seems like I see no harm in getting a PR that implements that in. |
Ok, I will make it |
Any chances of having some docs on how to use this? |
It’s not out in a release yet. When it’s released, we’ll add some docs. |
Cool, thanks for the update. |
@RangerMauve I'll release a valid React / React Native project when CRA will be updated |
@grigio Perfect! I'll make sure to stalk your github in anticipation. 😉 |
@RangerMauve here is the example app which is both a valid React Native / React Native Web project https://news.ycombinator.com/item?id=12379070 |
@grigio Thanks for the example app. Would you please shed some light on how to use create-react-app script to generate a similar app? at least with that directory structure? I assume I'll need to create an app via create-react-app, then add all react-native required dependencies, source files,...etc. I'm, not sure how useful create-react-app to create a web capable "Native" app. |
cc @lacker, #316 (comment) would be an interesting direction to explore. |
@remon-georgy currently I used If "the Web" will be an official React Native platform, I expect to run it seamlessly.
|
Thanks @grigio! I followed a similar approach and it works perfectly. Hopefully Web will be a standard react-native platform in the future. |
@remon-georgy what navigation package did you use? I'm having compile time errors that say a loader might be missing from using |
Using create-react-app without ejecting has proven to be hard since it doesn't compile node_modules and it uses a different babel preset from react-native. |
I have ejected in order to try and plug in the necessary loader. But i cannot seem to get it working. This is what i get:
|
In the webpack config with the babel-loader you'll need to add Edit: Somewhere around here |
@grigio I know this is a pretty old issue, but I'm reading about implementing
Would you be so kind to explain what the |
I'd like to use
create-react-app
with React Native Webhttps://github.com/grabcode/react-native-web-starter/blob/master/web/webpack.config.dev.js#L38-L42
The text was updated successfully, but these errors were encountered: