mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
Grammar + spelling.
This commit is contained in:
parent
5a9c33b222
commit
ff809cbc05
@ -48,7 +48,7 @@ When using Babel, you’ll need to make sure that Babel can parse the dynamic im
|
||||
Weckpack's default behaviour, is to name them as `x.js` where x is an incremental number depending on how many dynamic
|
||||
chunks you are importing in your code.
|
||||
|
||||
This will give a very poorly view of which file is loading what code.
|
||||
This will give a poor view of which file is loading what code.
|
||||
|
||||
To fix that, webpack introduced magic comments, with which a chunk can be named as follows (ie: `math.js`).
|
||||
|
||||
@ -59,14 +59,14 @@ import(/* webpackChunkName: "math" */ './math').then(math => {
|
||||
```
|
||||
|
||||
>NOTE:
|
||||
>When using [Server Side Rendering](/docs/server-side-rendering/), make sure comment and file path are exacly in the same order as above.
|
||||
>When using [Server Side Rendering](/docs/server-side-rendering/), make sure comment and file path are exactly in the same order as above.
|
||||
|
||||
|
||||
## Code Splitting + React
|
||||
|
||||
React supports code splitting out of the box with [`React.lazy`](https://reactjs.org/docs/code-splitting.html#reactlazy). However it has [some limitations](/docs/loadable-vs-react-lazy), this is why `@loadable/component` exists.
|
||||
|
||||
In a React application, most of the time you want to split your components. Splitting a component implies to be able to wait for this component to be loaded (showing a fallback during loading) but also to handle errors.
|
||||
In a React application, most of the time you want to split your components. Splitting a component implies the ability to wait for this component to be loaded (showing a fallback during loading) but also to handle errors.
|
||||
|
||||
**Example of component splitting:**
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user