Skip to content

Commit f9e00d5

Browse files
authored
Update lazy-load-react.md
Use import() to lazy load files as it is now supported in webpack 2 as opposed to previously using System.import
1 parent 048be25 commit f9e00d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/guides/lazy-load-react.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Lets have a look at a consumer choosing to lazily load some components. The `imp
1313

1414
```jsx
1515
<LazilyLoad modules={{
16-
TodoHandler: () => importLazy(System.import('./components/TodoHandler')),
17-
TodoMenuHandler: () => importLazy(System.import('./components/TodoMenuHandler')),
18-
TodoMenu: () => importLazy(System.import('./components/TodoMenu')),
16+
TodoHandler: () => importLazy(import('./components/TodoHandler')),
17+
TodoMenuHandler: () => importLazy(import('./components/TodoMenuHandler')),
18+
TodoMenu: () => importLazy(import('./components/TodoMenu')),
1919
}}>
2020
{({TodoHandler, TodoMenuHandler, TodoMenu}) => (
2121
<TodoHandler>
@@ -54,7 +54,7 @@ class Highlight extends React.Component {
5454
}
5555
}
5656
export LazilyLoadFactory(Highlight, {
57-
highlight: () => System.import('highlight'),
57+
highlight: () => import('highlight'),
5858
});
5959
```
6060

0 commit comments

Comments
 (0)