|
|
|
|
|
by kwkelly
1036 days ago
|
|
You have to be careful with code like the above in React. Using a lower-cased function that returns JSX but is not rendered with react.createElement (either directly or via the JSX syntax) can lead to confusing violations of the rules of hooks as it relates to exact ordering of calls. This is because it doesn't get registered as it's own component, so conditionally called children with hooks may cause errors. |
|
So this style of code is fine in react