Skip to content

Commit

Permalink
[docs] Update the guide for migrating to TSS (#34417)
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Sep 26, 2022
1 parent a3b4103 commit 9c50a6b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 69 deletions.
23 changes: 0 additions & 23 deletions docs/data/material/migration/migration-v4/migrating-from-jss-pt.md
Expand Up @@ -208,29 +208,6 @@ With yarn:
yarn add tss-react
```

You will also need to edit your providers:

```diff
import { render } from 'react-dom';
-import { StylesProvider } from '@material-ui/core/styles';
+import createCache from '@emotion/cache';
+import { CacheProvider } from "@emotion/react";

+export const muiCache = createCache({
+ 'key': 'mui',
+ 'prepend': true,
+});

render(
- <StylesProvider injectFirst>
+ <CacheProvider value={muiCache}>
<Root />
- </StylesProvider>,
+ </CacheProvider>,
document.getElementById('root')
);
```

#### Codemod

We provide [a codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#jss-to-tss-react) to help migrate JSS styles to the `tss-react` API.
Expand Down
23 changes: 0 additions & 23 deletions docs/data/material/migration/migration-v4/migrating-from-jss-zh.md
Expand Up @@ -207,29 +207,6 @@ npm install tss-react
yarn add tss-react
```

你还需要编辑你的提供者:

```diff
import { render } from 'react-dom';
-import { StylesProvider } from '@material-ui/core/styles';
+import createCache from '@emotion/cache';
+import { CacheProvider } from "@emotion/react";

+export const muiCache = createCache({
+ 'key': 'mui',
+ 'prepend': true,
+});

render(
- <StylesProvider injectFirst>
+ <CacheProvider value={muiCache}>
<Root />
- </StylesProvider>,
+ </CacheProvider>,
document.getElementById('root')
);
```

#### Codemod

我们提供了[一个codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#jss-to-tss-react)来帮助将JSS样式迁移到`tss-react` API。
Expand Down
23 changes: 0 additions & 23 deletions docs/data/material/migration/migration-v4/migrating-from-jss.md
Expand Up @@ -212,29 +212,6 @@ With yarn:
yarn add tss-react
```

You will also need to edit your providers:

```diff
import { render } from 'react-dom';
-import { StylesProvider } from '@material-ui/core/styles';
+import createCache from '@emotion/cache';
+import { CacheProvider } from "@emotion/react";

+export const muiCache = createCache({
+ 'key': 'mui',
+ 'prepend': true,
+});

render(
- <StylesProvider injectFirst>
+ <CacheProvider value={muiCache}>
<Root />
- </StylesProvider>,
+ </CacheProvider>,
document.getElementById('root')
);
```

#### Codemod

We provide [a codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#jss-to-tss-react) to help migrate JSS styles to the `tss-react` API.
Expand Down

0 comments on commit 9c50a6b

Please sign in to comment.