File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff 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-
You can’t perform that action at this time.
0 commit comments