Code Monkey home page Code Monkey logo

react-native-plus-web's Introduction

React Native + Web Boilerplate

Ultimate React Native + Web Boilerplate. This boilerplate is created on top of React Native and React Native Web. The idea is create project with seamless development experience and shareable codebase for both react native and react native web.

Key Feature

  1. Clear project structure & dependencies using lerna.
  2. React Native project support symlink and webpack ecosystem using haul.
  3. Built-in Navigation (react navigation and react-router).
  4. Web history API support.
  5. Same navigation API using react navigation API style.
  6. Wrap some react native component that currently not implemented yet on react-native web (Modal)

⚡️ Get Started Immediately ⚡️

Clone this repository and install all dependencies

  git clone [email protected]:drgx/react-native-plus-web.git
  cd react-native-plus-web
  yarn 

  # bootstrap all package dependencies 
  yarn bootstrap

🌟Preview 🌟

preview

Running Apps

You need to start the server by following this commend:

cd packages/apps/
yarn haul 
#choose to run server between Ios, Android or Both Ios and Android

For running android

Open your android emulator or plug your android devices

Simply run react-native run-android.

Since react-native v0.52+ to be able to start using haul you need to disable delta (cmd+m -> dev setting, uncheck use js deltas) and debug JS remotely on our emulator or devices. See haul limitation & issue. This issue is likely fix by haul team soon.

For running ios

Open your ios simulator. Simply run react-native run-ios on your terminal.

Running Web

cd packages/web/
yarn watch:web 
# open http://localhost:3000 on your browser

Folder structure

react-native-plus-web
├── README.md
├── lerna.json
├── package.json
└── packages
    ├── apps      <<<< React Native Project
    │   ├── android
    │   ├── app.json
    │   ├── index.js
    │   ├── ios
    │   ├── package.json
    │   ├── webpack.haul.js
    │   └── yarn.lock
    ├── shared    <<<< Shared code between apps and web
    │   ├── components
    │   │   ├── Modal 
    │   │   └── Navigator
    │   ├── constants
    │   │   └── routes.js 
    │   ├── package-lock.json
    │   ├── package.json
    │   └── yarn.lock
    └── web       <<<< React Native web Project
        ├── font.js
        ├── index.web.js
        ├── loaderConfiguration.js
        ├── package.json
        ├── template.html
        ├── webpack.common.js
        ├── webpack.dev.js
        ├── webpack.prod.js
        └── yarn.lock

Routes & Navigation

For editing or adding new routes simply edit routes.js

And for moving between screen simply use this.props.navigation to navigate based on routes definition on routes.js

# Example to navigate to detail screen
 <Button
  title="Navigate to Detail Screen"
  onPress={() => {
    this.props.navigation.navigate("Detail");
  }}
/>

# Example to back
<Button
  title="Back"
  onPress={() => {
    this.props.navigation.goBack();
  }}
/>

Contributing

We'd ❤️ to have your helping hand on react-native-plus-web! Feel free to PR's, add issues or give feedback! Happy Hacking!! 😎

react-native-plus-web's People

Contributors

drgx avatar ggarri avatar sonnylazuardi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-plus-web's Issues

Cant find module SharedComponent

When I try to run the project on Android device, without haul (Haul raises an error about delta bundle that I cant find on the company's devices) it raises another error:

error: bundling failed: Error: Unable to resolve module shared/components/SharedComponent from /home/vitor/Repositories/Components/pd/react-native-plus-web/packages/apps/index.js: The module ../shared/components/SharedComponent could not be found from /home/vitor/Repositories/Components/pd/react-native-plus-web/packages/apps/index.js.

I am new to monorepos, lerna and stuff, but I think this is related to it.

Any sugestion to get this solved?

Cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.