You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Right now, we don't produce an error for early returns:
@componentdefexample():
ifTrue:
returnNoneuse_state() # should produce error
There is no technical reason that this couldn't be supported however, as per this comment:
...semantics get very confusing. What would happen to state below? Would it be reset or preserved? What about effects? Would they be cleaned up (like on unmount) or would they run normally? If you think about it you’ll find cases that are very confusing regardless of the behavior you pick. Therefore, we disallow this pattern altogether. Put early return after calls to Hooks.