DEV Community

Mimis161x
Mimis161x

Posted on

Having trouble with react component hooks...

Image description

Image description

Ok so, im trying to pass a function ( eseentialy they are jsx components, listmap or listasc) as a prop to my component there, so that the fetch function either just displays the data or first sort the data and then display them on screen.

The handlechange is being triggered from an Onchange event in a selector

Image description

So when i get into the site, in the console it logs the normal obj array and the sorted one, the first time i change the selector to ascending it displays the ascending order, and nothing works past that, its like the component doesnt rerender. Any help please?

Top comments (0)