Replies: 1 comment 14 replies
-
No, you can only call hooks from other hooks or fictional components. Those are the rules of hooks. Why would you need to do that? |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, everyone. This library is amazing! Thank you to all those involved with its development.
I was wondering if anyone could provide some guidance on best practices for my use case.
I just want to extract my useMutations that are currently located inside my function component body to a helpers file.
It currently looks something like this:
Is it possible to move spPostResourceType out of this component and create a custom
usePostResourceType
hook without getting an invalid hook call outside of a function component?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions