@@ -83,3 +83,43 @@ source: crates/oxc_linter/src/tester.rs
8383 · ╰── The prop was declared here
8484 ╰────
8585 help : simplify props or memoize props in the parent component (https :// react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
86+
87+ ⚠ eslint - plugin - react - perf (jsx - no - new -object -as -prop ): JSX attribute values should not contain objects created in the same scope .
88+ ╭─[jsx_no_new_object_as_prop .tsx :1 :27 ]
89+ 1 │ const Foo = () => { const x: Foo = {}; return <Bar x = { x } /> }
90+ · ───┬── ─┬ ┬
91+ · │ │ ╰── And used here
92+ · │ ╰── And assigned a new value here
93+ · ╰── The prop was declared here
94+ ╰────
95+ help : simplify props or memoize props in the parent component (https :// react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
96+
97+ ⚠ eslint - plugin - react - perf (jsx - no - new -object -as -prop ): JSX attribute values should not contain objects created in the same scope .
98+ ╭─[jsx_no_new_object_as_prop .tsx :1 :27 ]
99+ 1 │ const Foo = () => { const x: Foo = {} as Foo ; return <Bar x = { x } /> }
100+ · ───┬── ─┬ ┬
101+ · │ │ ╰── And used here
102+ · │ ╰── And assigned a new value here
103+ · ╰── The prop was declared here
104+ ╰────
105+ help : simplify props or memoize props in the parent component (https :// react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
106+
107+ ⚠ eslint - plugin - react - perf (jsx - no - new -object -as -prop ): JSX attribute values should not contain objects created in the same scope .
108+ ╭─[jsx_no_new_object_as_prop .tsx :1 :27 ]
109+ 1 │ const Foo = () => { const x: Foo = {} satisfies Foo ; return <Bar x = { x } /> }
110+ · ───┬── ─┬ ┬
111+ · │ │ ╰── And used here
112+ · │ ╰── And assigned a new value here
113+ · ╰── The prop was declared here
114+ ╰────
115+ help : simplify props or memoize props in the parent component (https :// react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
116+
117+ ⚠ eslint - plugin - react - perf (jsx - no - new -object -as -prop ): JSX attribute values should not contain objects created in the same scope .
118+ ╭─[jsx_no_new_object_as_prop .tsx :1 :27 ]
119+ 1 │ const Foo = () => { const x: Foo = {} as const ; return <Bar x = { x } /> }
120+ · ───┬── ─┬ ┬
121+ · │ │ ╰── And used here
122+ · │ ╰── And assigned a new value here
123+ · ╰── The prop was declared here
124+ ╰────
125+ help : simplify props or memoize props in the parent component (https :// react.dev/reference/react/memo#my-component-rerenders-when-a-prop-is-an-object-or-array).
0 commit comments