Skip to content

Custom Hook and Runtime #2536

Discussion options

You must be logged in to vote

Hooks cannot be promises, this is a limit of react. Either pass it as a prop, find a way to suspend it with suspense reader api, or use top level awaits / state setting so you can await the hook then pass a prop into another react component etc.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ScriptedAlchemy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants