-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
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
Nesting React.functionComponent
leads to weirdness - what am I misunderstanding?
#640
Comments
It seems like you should not use Lines 17 to 28 in 6841c9b
The warning is wrongly configured, and should be updated to something like But in theory, when creating a function component in React you store it in a variable and then use it later as shown in your first example. |
As @MangelMaxime, let f = React.functionComponent (fun () -> Html.text "abc") becomes: [<ReactComponent>]
let F() = Html.text "abc"
Basically you should never call (or use if you call the React function declaration where it is being declared like |
This:
Looks like this:
However, this:
Looks like this:
What are the rules around calling
React.functionComponent
inside of a component?The text was updated successfully, but these errors were encountered: