We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to jsx-no-lambda, if in a prop you do:
jsx-no-lambda
<MyComponent style={{display: 'block'}} />
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:
render
render() { const style = {display: 'block'}; return <MyComponent style={style} /> }
but that could be a separate rule.
The text was updated successfully, but these errors were encountered:
Had similar thought during jsx-no-lambda rewrite.
More ideal case described above - move style variable outside of component. 😃
style
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.
Sorry, something went wrong.
Another thing to consider would be:
<MyComponent myProp={condition ? realValue : {}} />
Rule prohibiting use of object and array literals in props
de64cd4
By analogy to `jsx-no-lambda` and for same reasons. Closes palantir#89.
Closing due to deprecation timeline, see #210
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: