This is only anecdotal, but I think that let's say you have a component
const MyComp: React.FC = () => {
return null;
}
and then you add a hook
const MyComp: React.FC = () => {
const frame = useCurrentFrame();
return null;
}
There is a React error: "Rendered more hooks than before".
This is expected – but we intend to reload the Studio.
Same for when the order has changed and when there are fewer hooks now.
It seems to not work anymore recently.
We should also check if this applies to files:
- Where the component is not
export ed
- Where the
<Composition> is in the same file
Because we know this affects fast refresh.
Ideally we have some E2E tests that cover this.
This is only anecdotal, but I think that let's say you have a component
and then you add a hook
There is a React error: "Rendered more hooks than before".
This is expected – but we intend to reload the Studio.
Same for when the order has changed and when there are fewer hooks now.
It seems to not work anymore recently.
We should also check if this applies to files:
exported<Composition>is in the same fileBecause we know this affects fast refresh.
Ideally we have some E2E tests that cover this.