All Projects → inspmoore → rnw_boilerplate_nav

inspmoore / rnw_boilerplate_nav

Licence: MIT License
React Native Web boilerplate for universal web/native apps with a react-router/react-navigation combo navigation system.

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to rnw boilerplate nav

react-redux-semantic-ui
A starter boilerplate for a universal webapp using react, redux, express and feathers with Semantic UI theme
Stars: ✭ 39 (-27.78%)
Mutual labels:  universal
ASMapLauncher
ASMapLauncher is a library for iOS written in Swift that helps navigation with various mapping applications.
Stars: ✭ 41 (-24.07%)
Mutual labels:  navigation
poor-maps
Maps and navigation for Sailfish OS
Stars: ✭ 42 (-22.22%)
Mutual labels:  navigation
RouterService
💉Type-safe Navigation/Dependency Injection Framework for Swift
Stars: ✭ 212 (+292.59%)
Mutual labels:  navigation
SmartVHDL
SublimeText Plugin for VHDL (highlight, autocompletion, navigation, ...)
Stars: ✭ 12 (-77.78%)
Mutual labels:  navigation
XamFormsVMNav
Xamarin Forms ViewModel First Navigation
Stars: ✭ 22 (-59.26%)
Mutual labels:  navigation
stardust-SDK
Stardust SDK and sample app for Unity
Stars: ✭ 23 (-57.41%)
Mutual labels:  navigation
browser
Routing and Navigation for browser apps
Stars: ✭ 31 (-42.59%)
Mutual labels:  navigation
UWP-Flow-Frame
Flow Frame is a new and improved Frame control. This builds upon the default frame control by providing high-performance page transition animations powered by the composition layer. Fresh, new animations will be used by default, with options to configure the animations or even create your own custom animations (from scratch).
Stars: ✭ 14 (-74.07%)
Mutual labels:  navigation
react-native-navigation-drawer-extension
Drawer API built on top of wix react-native-navigation for iOS and Android (with TypeScript!)
Stars: ✭ 151 (+179.63%)
Mutual labels:  navigation
react-isomorphic-bundle
React Redux Universal (isomorphic) bundle
Stars: ✭ 53 (-1.85%)
Mutual labels:  universal
DeezerClone
This Application using Dagger Hilt, Coroutines, Flow, Jetpack (Room, ViewModel, LiveData),Navigation based on MVVM architecture.
Stars: ✭ 81 (+50%)
Mutual labels:  navigation
TET
TET- Trans Euro Trail - Public Files
Stars: ✭ 27 (-50%)
Mutual labels:  navigation
SlideNavigation
🐢 类似‘今日头条顶部导航栏跟手势滑动’效果
Stars: ✭ 18 (-66.67%)
Mutual labels:  navigation
fe-navigation
前端导航网站,优秀的前端资讯网站
Stars: ✭ 14 (-74.07%)
Mutual labels:  navigation
react-flappy-bird
A side-scroller where the player controls a bird, attempting to fly between columns of green pipes without hitting them.
Stars: ✭ 55 (+1.85%)
Mutual labels:  react-native-web
kwerri-oss
Kwerri OSS: samvloeberghs.be + jsonld + seo service + scully-plugin-minify-html + scully-plugin-disable-angular
Stars: ✭ 60 (+11.11%)
Mutual labels:  universal
react-hot-loader-starter-kit
react 16, redux 5, react router 4, universal, webpack 3
Stars: ✭ 41 (-24.07%)
Mutual labels:  universal
strickland
Strickland is a JavaScript validation framework with a focus on extensibility and composition
Stars: ✭ 16 (-70.37%)
Mutual labels:  universal
IoT-iBeacon
An Ionic app for indoor localization and navigation using BLE iBeacons.
Stars: ✭ 39 (-27.78%)
Mutual labels:  navigation

React Native Web Boilerplate 🥘 with navigation 🗺

A small and simple boilerplate for lazy people to create a universal Web/Native React app. How is that possible? By code sharing between both of those worlds. The most crucial element of this puzzle is a brilliant React Native Web library by Nicolas Gallagher.

This boilerplate will save you the hassle of configuring it by your own. Like I said. Lazy bones.

There's also version without app navigation built in. Check it out here.

Installing 🔩

Clone the repo and run

yarn

or

npm install

to install all the dependencies.

Scripts ️️️⚙️

The scripts are a mix of create-react-app and react-native.

yarn start-web or npm run start-web

Runs your app in the browser under the http://localhost:3000.

yarn start or npm run start

Starts metro bundler for your react native project.

yarn start-ios or npm run start-ios

Runs metro bundler and opens the app in the iOS simulator.

yarn build or npm run build

Builds your web app for production.

yarn test or npm run test

Runs the test environment for the native part.

yarn test-web or npm run test-web

Runs the test environment for the web part.

yarn eject or npm run eject

Eject your web project to your custom setup.

Usage 🛠

Folder and file structure is also a result of combination of create-react-app and react-native boilerplates.

rnw_boilerplate
├── android
├── ios
├── node_modules
├── public
├── src
│    ├── NativeWebRouteWrapper
│    │    ├── index.js
│    │    ├── pop.native.js
│    │    └── pop.web.js
│    ├── App.js
│    ├── App.native.js
│    ├── HomeScreen.js
│    ├── index.js - web index file
│    └── registerServiceWorker.js
├── app.json
├── index.js - native index file
├── package.json
└── README.md

HomeScreen.js file is an example of a component shared between the platforms. Thanks to React Native Web lib, it is possible to use React Native primitives in the Web environment. Please check out RNW guide for more details.

Also notice that there are separate App.js files for Web and Native. This gives a lot of advantages, including adding platform specific libraries to your app.

Navigation

In the native environment things are simple and easy. Just use react-navigation.

Web is however more complicated. In the spirit of RNW I've ported some react-navigation functionality using react-router-dom. Using a WebRoutesGenerator little helper function found in the NativeWebRouteWrapper lib you can create routes with a `react-navigation' like API.

First create a route map and pass it to the WebRoutesGenerator

const routeMap = {
  Home: {
    component: HomeScreen,
    path: "/",
    exact: true
  },
  Second: {
    component: SecondScreen,
    path: "/second"
  },
  User: {
    component: UserScreen,
    path: "/user/:name?",
    exact: true
  },
  DasModal: {
    component: DasModalScreen,
    path: "*/dasmodal",
    modal: true
  }
};

// in the render method
WebRoutesGenerator({ routeMap });

The components are wrapped in a HOC that adds navigation prop. This props has three methods to work with:

  • this.props.navigation
    • navigate(routeName, params) - go to a screen, pass params
    • goBack - goes one step back in history
    • getParam(paramName, fallback) - get a specific param with fallback

It's a limited copy of react-navigation navigation prop.

If you want to have a modal:

  • add a modal: true flag the route map
  • add <ModalContainer /> from react-router-modal to your app layout

Renaming the app ✏️

This boilerplate comes with ios and android bundles already named. If you want to (and you should) change the name, use the react-native-rename lib.

Contribution ❤️

This boilerplate was made for my own convenience and is still a work in progress. Please consider it as an experiment and think twice or even trice (is that a word?) before using it in production.

If you however would like to add something from yourself, please do make a PR! All contributions will be treated with great love!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].