Skip to content

Commit 2c020ba

Browse files
authored
No longer recreating histories within render functions in documentation (#150)
Co-authored-by: Patrick Shaw <[email protected]>
1 parent 51c18ff commit 2c020ba

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ import {
124124
} from 'react-resource-router';
125125
import { appRoutes } from './routing/routes';
126126

127+
const history = createBrowserHistory();
128+
127129
const App = () => (
128-
<Router routes={appRoutes} history={createBrowserHistory()}>
130+
<Router routes={appRoutes} history={history}>
129131
<RouteComponent />
130132
</Router>
131133
);

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ import {
118118
} from 'react-resource-router';
119119
import { appRoutes } from './routing/routes';
120120

121+
const history = createBrowserHistory();
122+
121123
const App = () => (
122-
<Router routes={appRoutes} history={createBrowserHistory()}>
124+
<Router routes={appRoutes} history={history}>
123125
<RouteComponent />
124126
</Router>
125127
);

docs/api/components.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ import {
194194
import { StaticNavigation } from '../components';
195195
import { routes } from '../routing';
196196

197+
const history = createBrowserHistory();
198+
197199
export const App = () => (
198-
<Router history={createBrowserHistory} routes={routes}>
200+
<Router history={history} routes={routes}>
199201
<StaticNavigation />
200202
<RouteComponent />
201203
</Router>

docs/router/ssr.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ import { Router, createBrowserHistory } from 'react-resource-router';
4747
import { App } from '../components';
4848
import { routes } from '../routing/routes';
4949

50+
const history = createBrowserHistory();
51+
5052
export const ClientApp = () => (
51-
<Router routes={routes} history={createBrowserHistory()}>
53+
<Router routes={routes} history={history}>
5254
<App />
5355
</Router>
5456
);

0 commit comments

Comments
 (0)