GroceriStar / react-only-intern-17

GNU General Public License v3.0
0 stars 0 forks source link

Master React, Quick Code tutorial. Part 6 #7

Open atherdon opened 6 years ago

atherdon commented 6 years ago

https://medium.com/quick-code/lets-learn-react-chapter-6-updating-component-state-80fcc7c01d24

Expected result

Test

1

chefigueroa-rodriguez commented 6 years ago

In this chapter we discussed how the setState function works, which updates our component state. It expects one parameter that is an object consisting of one or more key/value pairs. setState will take an object we pass it and replace the current component state on the given key with given value. You cannot push any object to the state because it will simply get updated and not returning the updated array.

atherdon commented 6 years ago

can you show me a code line where you did it?

atherdon commented 6 years ago

ok, checking your code right now. I assume we need to create a sub-component for a single meal. and please have at least 3 objects of meals(right now we have only one).

And please add fields, related to test.

atherdon commented 6 years ago

@che607 can you tell me - should i close this task, right?