My Account
Sign up, and CougarBoard will remember which categories you want to view.
Sign up
Report problem with this ad
Start a related thread
Start a related poll
Reply via Boardmail
Oct 2, 2022
3:25
:26
pm
zsmooth
Suss
RE: React.js question?
You’re capturing ‘input’ but never passing that up to the parent. I assume what you mean to do is call addTodo({id, task: input}) or something.
Start a related thread
Start a related poll
Reply via Boardmail
Report problem with this ad
zsmooth
Bio page
zsmooth
Joined
Nov 26, 2004
Last login
May 4, 2024
Total posts
5,803 (227 FO)
Report problem with this ad
Messages
Author
Time
React.js question?
Icelandic Cougar
10/2/22 3:15pm
This is so hard to read without formatting. Can you changed to preformatted in the CB editor?
zsmooth
10/2/22 3:20pm
Updated. Let me know if that's easier.
Icelandic Cougar
10/2/22 3:23pm
Looks like you are never actually changing the todo array state
Hypnotoad
10/2/22 3:24pm
Also, I don't see you mapping over the array in the JSX
Hypnotoad
10/2/22 3:25pm
Looks like this is just the form, not the list.
zsmooth
10/2/22 3:25pm
Yeah. But they means he's not sharing the parent component, which we would need
Hypnotoad
10/2/22 3:28pm
RE: Yeah. But they means he's not sharing the parent component, which we would need
zsmooth
10/2/22 3:36pm
I can see some syntax errors.
Brooklyn
10/2/22 3:25pm
RE: React.js question?
zsmooth
10/2/22 3:25pm
The value of the input is stored in state on change. He's using that state when
Hypnotoad
10/2/22 3:31pm
Part of the problem might be my list. It's very basic. Here it is as of now.
Icelandic Cougar
10/2/22 3:33pm
That component is purely passthrough. It does nothing but return TODO. Your
Hypnotoad
10/2/22 3:37pm
I feel like I'm close, but obviously still missing something. Brain is mush.
Icelandic Cougar
10/2/22 4:16pm
Look closer - it's not. He logs it on onSubmit, but he doesn't pass it up.
zsmooth
10/2/22 3:33pm
You're right. input is assigned but never read. Overall, this component can be
Hypnotoad
10/2/22 3:40pm
Try this
zsmooth
10/2/22 3:32pm
Report problem with this ad
Posting on CougarBoard
In order to post, you will need to either
sign up
or
log in
.
Report problem with this ad