Skip to content

Commit

Permalink
[codemod] Fix variant prop placement (#31990)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancogswell authored Mar 28, 2022
1 parent 6d0bb90 commit 9ff2330
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/mui-codemod/src/v5.0.0/variant-prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function transformer(file, api, options) {
);

if (!variant) {
attributes.push(j.jsxAttribute(j.jsxIdentifier('variant'), j.literal('standard')));
attributes.unshift(j.jsxAttribute(j.jsxIdentifier('variant'), j.literal('standard')));
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/mui-codemod/src/v5.0.0/variant-prop.test/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import FormControl from '@material-ui/core/FormControl';
export default function TextFieldComponent(props) {
return (
<div>
<TextField {...props} variant="standard" />
<TextField variant="standard" {...props} />
<TextField variant="outlined" />
<TextField variant="standard" />
<TextField variant="filled" />
<Select {...props} variant="standard" />
<Select variant="standard" {...props} />
<Select variant="outlined" />
<Select variant="standard" />
<Select variant="filled" />
<FormControl {...props} variant="standard" />
<FormControl variant="standard" {...props} />
<FormControl variant="outlined" />
<FormControl variant="standard" />
<FormControl variant="filled" />
Expand Down

0 comments on commit 9ff2330

Please sign in to comment.