import createBrowserHistory from 'history/
import appState from './AppState'
const customHistory = createBrowserHistory()
ReactDOM.render(
<Router>
<div>
<Route path="/submit" component={Submit} history={history}/>
</div>
</Router>,
document.getElementById('root')
);
Notice: if I add appState like other properties; there is not property such as appState in Submit component,
if I use this;
<Route path="/submit" render={routeProps=> <Submit appState={appState}/> history={history}/>
appState pass fine but this time history object is missing, what is proper way of doing this? appState is just mobx class instance.
EDITED: I found a "weird" solution. i changed route element to this;
<Route path="/submit" render={routeProps=> <Submit appState={appState}/> history={history}/>
then I am able to access same history object via this._reactInternalInstance._context.router.history.push('/home')
before I made this change i was able to use it as this.props.history.push('/home')
if I leave this as it works fine but its annoying getting this history object with this way