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)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

πŸ‘₯ Ideal for solo developers, teams, and cross-company projects

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay