Git Product home page Git Product logo

react-mobx-router5-example's Introduction

react-mobx-router5-example

This is a simple setup example for the react-mobx-router5 project.

Install and Run

  • Fork, clone, or download the project:
git clone https://github.com/LeonardoGentile/react-mobx-router5-example.git
  • Then install the dependencies:
npm install
  • Run development server:
npm start

Open the web browser to http://localhost:8888/

Routes and Nodes

The project uses this routes configuration:

export default [
  { name: 'home', path: '/', component: Home},
  { name: 'login', path: '/login', component: Login},
  { name: 'index', path: '/index/:id', component: Index},
  { name: 'section', path: '/section', component: Sections, children: [
    // Sections
    { name: 'home', path: '/home', component: Home },
    { name: 'login', path: '/login', component: Login },
    { name: 'index', path: '/index/:id', component: Index },
    { name: 'subsection', path: '/subsection', component: SubSections, children: [
      // Subsections
      { name: 'home', path: '/home', component: Home },
      { name: 'login', path: '/login', component: Login },
      { name: 'index', path: '/index/:id', component: Index }
    ]}
  ]}
];

That means that the nodes of this app are:

  • '' the root node, see the Main component
  • 'section', see the Sections component
  • 'section.subsection', see the Subsections component

All this components should be wrapped with routeNode HOC.
Notice that routeNode HOC injects an observable route, a non-observable plainRoute and a (mobx-router5) routerStore prop to the wrapped component.

Each one of these uses in turn the RouteView component, resposnsible to select and render the various subcomponent.
Notice that a RouteView component injects a route prop to the newly created component.

The better way to learn about react-mobx-router5 is to view the source code and play around with this example.

If you have any trouble or doubt please open an issue either here or on react-mobx-router5 repo.

react-mobx-router5-example's People

Contributors

leonardogentile avatar

Stargazers

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

Watchers

 avatar  avatar

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.