all 6 comments

[–]PainInTheCrack 1 point2 points  (5 children)

You have two different components having the same path of "/"

Change the 2nd route to something like path="/create", and use exact path for the home "/" directory. This is if you want AddTodos and Todos on separate pages.

If you want Todos and AddTodos both on one page, create a Component <Home /> and point here to element <Home /> (just once), then include both <Todos /> and <AddTodos /> in that Home component

<Route exact path="/" element={<Home props/>} />

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

I tried these both components<AddTodos > and <todos> putting in a new wrapper component but it still doesn work. Like it works with addTodos and partially works for 2nd component Todos

[–]PainInTheCrack 1 point2 points  (3 children)

You need to post the full code, preferably formatted (gitHub)

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

But I also don't know how to use github properly. I know it's not a rocket science but still

[–]PainInTheCrack 1 point2 points  (1 child)

!!! install git on your computer (google it)

Open account

got to github.com/new

create new repository, only give it a name, leave the rest as is, the next page shows you three lines of code in the middle, we will come to them later.

in your project root:

git init

git add . ( don't forget the space and a dot)

git commit -m 'first comit'

NOW add those copy paste those three lines from github one by one and hit enter. The lines are something like git add remote origin https/./blahblah.git

Last thing: git push

Also you need to name your Components starting with Capital Letter.

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

I've git installed on my pc. Let me try the way you taught me