-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linter/react_perf): allow new objects, array, fns, etc in top sco…
…pe (#4395) Consider the following code: ```tsx import { FC } from 'react' import { SvgIcon } from '@mui/material' const StyledIcon = <SvgIcon sx={{ padding: 1, color: '#ff0000' }} /> // reported violation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ export const MyComponent: FC = () => { return ( <div> {StyledIcon} {/* ... */} </div> ) } ``` This should not be a violation since the JSX is pre-computed and re-used, which does not break React's `Object.is()` checks.
- Loading branch information
Showing
9 changed files
with
147 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.