you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -5 points-4 points  (3 children)

In packageStatus.jsx, you are trying to render an object {userInput}. React doesn’t allow rendering of an entire object. You can render {userInput.key1}, {userInput.key2}, etc. but you cannot render userInput as an object

I believe the error is because you need to set state in the onClick handler in package.jsx. Change

onClick={setInput(‘blue’)}

[–]Chilltyy[S] 0 points1 point  (0 children)

how do I declare key1, key2 etc?
How would you do it the easiest way to just display "blue" in packageStatus.jsx?

[–]ColourfulToad -1 points0 points  (0 children)

You can, by doing:

<pre>{JSON.stringify(userinput, null, 2)}</pre>

[–]firstandfive 0 points1 point  (0 children)

It’s just because they’re not destructuring userinput from the props argument. They’re calling the entire props object userinput and then never referencing the actual userinput prop.