Skip to content

Commit

Permalink
Add documentation about specific scenarios that are not supported by …
Browse files Browse the repository at this point in the history
…the codemod
  • Loading branch information
ryancogswell committed May 10, 2022
1 parent d625dc5 commit f20875f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/mui-codemod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,19 @@ export default App;
npx @mui/codemod v5.0.0/jss-to-tss-react <path>
```

The following scenarios are not currently handled by this codemod and will be marked with a
"TODO jss-to-tss-react codemod" comment:

- If the hook returned by `makeStyles` (e.g. `useStyles`) is exported and used in another file,
the usages in other files will not be converted.
- Arrow functions as the value for a CSS prop will not be converted. Arrow functions **are**
supported at the rule level, though with some caveats listed below.
- In order for arrow functions at the rule level to be converted, the parameter must use object
destructuring (e.g. `root: ({color, padding}) => (...)`). If the parameter is not destructured
(e.g. `root: (props) => (...)`), it will not be converted.
- If an arrow function at the rule level contains a code block (i.e. contains an explicit `return`
statement) rather than just an object expression, it will not be converted.

You can find more details about migrating from JSS to tss-react in [the migration guide](https://mui.com/guides/migration-v4/#2-use-tss-react).

#### `link-underline-hover`
Expand Down

0 comments on commit f20875f

Please sign in to comment.