rememberedState of undefined - React
See original GitHub issueVersions:
@inertiajs/inertia
version: ^0.10.1@inertiajs/inertia-react
version: ^0.7.1
Describe the problem:
Try use useRemember hook but return error “rememberedState of undefined”
Steps to reproduce:
Into component try use an example displayed in section “Remembering state”
Error
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:6 (1 by maintainers)
Top Results From Across the Web
inertia-react@0.8.0
inertia-react@0.8.0 ... "rememberedState of undefined" occurred on visits where useRemember was used (#949); useForm overload types were ...
Read more >React State giving undefined, new to react - Stack Overflow
It looks like you're getting undefined while the data is loading (as the data isn't there yet and it's therefore undefined), you're printing ......
Read more >Persisent children with tabbed pages with Inertia.js and React
I am trying to implement tabbed pages with Inertia.js and React. An example of this is seen ... And could you perhaps nest...
Read more >React JS UNDEFINED Solution | Reactjs Learning - YouTube
As a React JS developer, have you encountered such errors?- TypeError: Cannot read property 'map' of undefined - Map is not a function-...
Read more >Watch Out for Undefined State - Dave Ceddia
Quick quiz: When a React component loads data from the server in componentWillMount like this one below, what will it render? Beware Undefined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We experienced the same issue so I did some digging. It only happens on the first page load. If I navigate to the page using
useRemember
from another page it loads fine.The issue appeared when we switched from the old rendering method (directly rendering App) to using
createInertiaApp
.It appears the
useRemember
hook runs before Inertia is initialised.useRemember
callsInertia.remember
internally. Theremember
method relies onthis.page
being set on the Inertia instance. This happens when theinit
method is called, which happens increateInertiaMethod
. When I log fromuseRemember
andinit
it seems likeuseRemember
is called before theinit
method.@reinink @claudiodekker any chance you or claudio can take a look at this? The remember functionality of
useForm
is basically not working, at all.