Skip to content
Advertisement

Tag: react-hooks

Equivalent of setState callback with React hooks

I have a modal with a list of answers. I can either click an answer to select it, then click a button to confirm my choice. Or I can double-click an answer to select it and confirm. I’m having trouble properly handling the double-click case. With React class components, I would have used setState()’s callback like this: But right now,

how can I display a list of contacts with name, age, location, and phone props in react? my code does not display anything

there are three components namely; AddPersonForm, PeopleIst, and ContactManager AddPersonForm is a form with the text field and add button and uses state to manage the value of the text field PeopleList is a list of contacts and receives an array representing the contacts and renders a list on the page ContactManager includes the AddPersonForm and PeopleList as child components

Advertisement