React Router

React Router V4 and Redux integration.

Internally, uses react-router-dom for browser based apps and react-router-native for react native apps. Moreover, re-exports both packages on their respective platforms.

Usage

Run the following command in the plugin directoy:

npm i --save @blueeast/bluerain-plugin-react-router

Then in your boot function, pass the plugin like this:

import BR from '@blueeast/bluerain-os';
import ReactRouterPlugin from '@blueeast/bluerain-plugin-react-router';

BR.boot({
    plugins: [ReactRouterPlugin]
})

Components

This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins:

Filters

None.

API

ReactRouterPluginConfigs

This is the default configuration set that is used at boot time.

Properties

  • androidBackButton boolean [default: true] Listen for Android Back button on React Native. Details

  • deepLinking boolean [default: false] Enable deep linking on react native. Details

ReactRouterPlugin

Extends Plugin

React Router (v4) plugin to add routing capabilities to BlueRain Apps.

Properties

RouterRef

This plugin saves router object in the BlueRain context. This can be accessed in the following way:

const router = ctx.refs.router;

Properties

  • history object React Router's history object

withRouterActions

withRouterActions higher order component that passes router action functions inside router prop. The functions include: push, replace, go, goBack, goForward

Parameters

  • Component Component

Last updated