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

feat: add web to the example #294

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Nov 2, 2021

Issue: closes #170

What I did

I added react native web to the example project.

I've followed this blog post https://arry.medium.com/how-to-add-react-native-web-to-an-existing-react-native-project-eb98c952c12f

Some config was adjusted, however for the most part it remains the same as in the blog.

How to test

  1. cd examples/native
  2. yarn web

@dannyhw dannyhw added the 6.5 label Nov 2, 2021
@dannyhw dannyhw self-assigned this Nov 2, 2021
Copy link

@barnsdev barnsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked out and ran yarn web and all working fine in browser.

Checked that iOS and Android still working fine too and all good there.

Looks good to me @dannyhw

@dannyhw dannyhw merged commit e2d3c5a into next-6.0 Nov 3, 2021
@sangameshsomawar
Copy link

@devbarn : Getting errors while running yarn web on both branches (feat/example-react-native-web and next-6.0)
Please help.

Screenshot 2021-11-15 at 10 23 59 AM

@dannyhw
Copy link
Member Author

dannyhw commented Nov 15, 2021

@sangameshsomawar try running yarn prepareAll in the root of the project.

@sangameshsomawar
Copy link

@dannyhw : Now it's working, Please explain the magic of yarn prepareAll.

One more question, how to build this as a static website,
I tried with the below approach, It created a dist folder but I could not open it as a static site.
"build-react": "webpack --mode production --config webpack.config.js"

@sangameshsomawar
Copy link

@dannyhw

http-server dist/ this is working for me. Do you have any other way to serve as a static site?

@dannyhw
Copy link
Member Author

dannyhw commented Nov 15, 2021

@sangameshsomawar prepare all just runs prepare on every package. It's possible that something didn't work during the bootstrap command for you.

Could you create an issue about the build command because I think this PR is not the right place for that.

I haven't really tried to make a build since that's more like a webpack config thing as far as I can tell and not necessarily needed for our example app.

@sangameshsomawar
Copy link

@dannyhw Thanks,
I will create new issue for build command.

dannyhw added a commit to raychanks/react-native that referenced this pull request Feb 7, 2022
dannyhw added a commit that referenced this pull request Feb 7, 2022
@dannyhw dannyhw deleted the feat/example-react-native-web branch February 2, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[6.0] add react native web to the example app
3 participants