Skip to content

Commit d9ca455

Browse files
committed
update README.md
1 parent 4da9e57 commit d9ca455

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ export default function App() {
3434
someProp1,
3535
someProp2, // `someProp1` and `someProp2` are transfered to `module.dedault` above finally
3636
}}
37-
/>
37+
onError={e => {
38+
if (
39+
e.message.startsWith('Cannot find module') &&
40+
window.location.pathname !== '/404'
41+
) {
42+
history.push('/404')
43+
return
44+
}
45+
throw e
46+
}}
47+
/>
3848
</BrowserRouter>
3949
)
4050
}
@@ -82,15 +92,9 @@ export default function App() {
8292
<DynamicRoute
8393
page={path => import('./pages' + path).then(module => module.default)}
8494
loading={<div>Loading..</div>}
85-
props={{
86-
someProp1,
87-
someProp2, // `someProp1` and `someProp2` are transfered to `module.default` above finally
88-
}}
8995
/>
9096
</Switch>
9197
</BrowserRouter>
9298
)
9399
}
94100
```
95-
96-

0 commit comments

Comments
 (0)