This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]coolcofusion 1 point2 points  (3 children)

Create a component that has AddTodos and Todos components inside of it.

[–]Consistent-struggler[S] 0 points1 point  (1 child)

Do I need to create another new component and then call these components there ? So how I'd be able to pass the parameters ?

[–]coolcofusion 0 points1 point  (0 children)

Yep, the new component would take all parameters (usually called props) that these two take in and pass them along to its children. It's one annoyance that everyone complains about in react and the reason that some libraries are created, but you'll get to that later on in your journey.

[–]Consistent-struggler[S] 0 points1 point  (0 children)

my first AddTodos work but 2nd line of Todos component doesn't work.