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
The main point of hooks is to attach logic to the component lifecycle like when it renders, when it's created or when it's destroyed. Using hooks for anything else is not necessary. An event handler is not part of the component lifecycle. It's just a function that the browser calls in response to some event. It runs completely separate from the component lifecycle
Hooks can only be used inside a component context, which is why this error is thrown. But here the useEffect is called inside an event handler instead. Event handlers are not part of the component lifecycle.
In your case you don't even need a hook in there. You can just call the fetch directly.
In
islands/test.tsx
:In
routes/index.tsx
:Do you have any idea why this happens?
The text was updated successfully, but these errors were encountered: