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
The following code:
@react.component let make = () => { let className = React.useMemo0(() => "rescript + react + emotion + styled-ppx rocks!") <div className /> }
...triggers an error:
3 | let className = React.useMemo0(() => "rescript + react + emotion + styled-ppx rocks!") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: Hooks can't be inside conditionals, neither loops.
The text was updated successfully, but these errors were encountered:
The following seems to work though:
@react.component let make = () => { React.useMemo0(() => "rescript + react + emotion + styled-ppx rocks!") }
Sorry, something went wrong.
Hey @webican
Seems like the logic to detect if hooks are being called on the top have a bug where considers the useMemo call to be "inside" the JSX transformation.
I will look into it, since there are a few cases that this linter isn't aligned with what the ESLint plugin does.
Thanks for reporting
Successfully merging a pull request may close this issue.
The following code:
...triggers an error:
The text was updated successfully, but these errors were encountered: