Skip to content

Commit

Permalink
[docs] Make using the Migration bootstrap clearer (#15270)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwjohnston authored and oliviertassinari committed Apr 9, 2019
1 parent 4fb4d07 commit 654bd87
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/src/pages/css-in-js/basics/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ install();
```

It is **recommended** to place the above code in a separate file (e.g. `bootstrap.js`) and to import it in your application's entry point (e.g. `index.js`).

This bootstrap file should be imported before any of your own components that use Material-UI components.

eg.

```
import "./bootstrap";
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';
import { ThemeProvider } from '@material-ui/styles';
```

This ensures that the installation is executed before anything else, because ECMAScript imports are hoisted to the top of the module. If the installation step is not performed correctly the resulting build could have conflicting class names.

We will make `@material-ui/styles` the default style implementation for the core components in Material-UI v4. This installation step is **temporary**.
Expand Down

0 comments on commit 654bd87

Please sign in to comment.