2.6.0 • Published 3 years ago
onsenui-react-redux-navigator v2.6.0
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:
idan id string to uniquely identify the navigator in the app, so we can track multiple active navigators (such as, one per tab).rootRoutetheRouteto show in the navigator when it is first loaded.stateSelectora function to select the routing state from the Redux store.
Route is an object that contains the following properties:
componenta React component class to render the page in the navigator.titlethe title of the page.propsprops 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.