Skip to content
Advertisement

Tag: reactjs

Need Help Figuring Out State in React

I’m working on a basic Todo app. I’m storing the todo items in state as an array of objects. The object key is the todo item, the value is either true(done) or false(not done). When I click a button to check off an item, I want to change the value of the todo item as well as change the style

onChange doesn’t work when value of input clears

I have a problem in handling input’s value changing so here is my code in react,onChange works but when i clear the default value it doesn’t log anything until i do another change. I wrote console.log just for test. Answer Value is not changing because in reactjs component rerenders once state chages and using console.log on onChange does not update

React map through json object

I am having trouble finding a way to iterate through this nested JSON data. I would like to display elements into select option list. I store my data in a state after a request. I already tried: Last one gives my TypeError: Cannot read property ‘map’ of undefined. If i try to set my state to setFilterData(res.data.regions) then i can

Advertisement