onsenui-react-redux-navigator
TypeScript icon, indicating that this package has built-in type declarations

2.6.0 • Public • Published

onsenui-react-redux-navigator

A package to integrate Redux with an Onsen UI <RouterNavigator> React component.

We setup a React component, <ReduxNavigator>, that provides a context to child React components allowing them to push new pages, to pop, and to render a title bar / toolbar including a page title and back button.

<ReduxNavigator requires the following parameters:

  • id an id string to uniquely identify the navigator in the app, so we can track multiple active navigators (such as, one per tab).
  • rootRoute the Route to show in the navigator when it is first loaded.
  • stateSelector a function to select the routing state from the Redux store.

Route is an object that contains the following properties:

  • component a React component class to render the page in the navigator.
  • title the title of the page.
  • props props to pass to the component

Example

See the example folder for a working example created using create-react-app with TypeScript.

Caveats

This relies on some extra type definitions for react-onsenui, which are included in the example.

Readme

Keywords

none

Package Sidebar

Install

npm i onsenui-react-redux-navigator

Weekly Downloads

3

Version

2.6.0

License

Apache-2.0

Unpacked Size

35.2 kB

Total Files

22

Last publish

Collaborators

  • karlvr