Deviation can be used with history and react-router the same way with Redux and connected-react-router. Below is the implementation of RouterService that will provide you the functionalities ofconnected-react-router.
Prerequisite
Before implementing RouterService, you need to install history and react-router-dom packages:
npminstall--savehistoryreact-router-dom
To use the HTML5 History API, you need to declare the RouterService and history inside it:
import { createBrowserHistory } from'history'import { Store } from'deviation'exportclassRouterServiceextendsStore { history =createBrowserHistory()}
Then in ReactDOM, provide Router with the history that you've created: