Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Update the guide for migrating to TSS #34417

Merged
merged 1 commit into from Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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