I'm trying to make a form that goes over different pages, so I have made a global state for just the form, but even tho my test form are the same I get different results, first page doesn't update second one is just wierd
all the code is here in github https://github.com/TOcvfan/formtest/
if I console.log e I get { fornavn: "whatever I typed" } on the first page and { fisse: "whatever I typed" } on the second page
#useState doesn't update as intended
6 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
Okay apparently nobody knows the solution to my problem or don't want to tell me..
luckily I found out myself
✅ Success!
This question has been marked as answered! If you have any other questions, feel free to create another post
Jump to answer
[Click here](#1143830035212537856 message)
Perhaps you could share your solution then, so others learn from it?
instead of this
const onSubmitSignIn = async (e) => { console.log(e) setData({ ...data, e }) router.push("/opret/bruger/info2"); }
I used this
const onSubmitSignIn = async (e) => { console.log(e) setData(data => ({ ...data, ...e })) router.push("/opret/bruger/info2"); }