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
prefer-stateless-function
null
With enabled rule prefer-stateless-function, the following does throw a warning although null may be returned:
class If extends Component { render() { const { condition, ...props } = this.props return condition ? <this.props.component {...props} /> : null } }
If we write the result to a variable, though, there is no warning:
class If extends Component { render() { const { condition, ...props } = this.props const component = condition ? <this.props.component {...props} /> : null return component } }
The text was updated successfully, but these errors were encountered:
aba4f96
No branches or pull requests
With enabled rule
prefer-stateless-function
, the following does throw a warning althoughnull
may be returned:If we write the result to a variable, though, there is no warning:
The text was updated successfully, but these errors were encountered: