Closed benbayard closed 5 years ago
Had similar thought during jsx-no-lambda
rewrite.
More ideal case described above - move style
variable outside of component. 😃
Also I'd like to suggest further improvements for both rule proposed in this issue as well as for jsx-no-lambda
:
<List items={props.items || []} />
)See React.js pure render performance anti-pattern for the reference.
Another thing to consider would be:
<MyComponent myProp={condition ? realValue : {}} />
Closing due to deprecation timeline, see #210
Similar to
jsx-no-lambda
, if in a prop you do:this will force any pure component to re-render every time.
Ideally, we could check in
render
to see if any new objects are generated there. Such as:but that could be a separate rule.