I think I need 3 components:
- LeaderBoard ( Parent)
- TableHead (Child of LeaderBoard)
- TableBody (Child of LeaderBoard)
When the component will mount this component loads the API-datas and give it as a property to the TableBody
It will display the datas that the LeaderBoars-Componets gives him as a property
No comes the problem
When someone will click to sort by recent or alltime, how can this component update the TableBody-Component?
Or is can childcomponents talk to each other?
One answer could be, that I only have one component. But I think that there has to be 3 Components… or am I wrong?
Here you can finde the codepen.