Custom Hook and Runtime #2536
-
I have tried to adopt Runtime for my project but I have encountered the problem of how to load a Atomic State from Jotai, The component I want to federate is the following:
Previously using buildTime my code looked like this:
But I am not being able to do the same in RunTime. Thank you for all your assistanc. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer, it was very helpful. |
Beta Was this translation helpful? Give feedback.
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.