score:3
your problem lies in the render method of your parent
component. you're iterating over the productseeds
array instead of your state. since you're updating the state and not the seed array react sees no reason to rerender anything and therefore nothing changes.
so if you change that line from
const productcomponents = productseed.map((product) => {...
to
const productcomponents = this.state.products.map((product) => {...
you should be fine.
moreover about your:
the line below suppose to point to the products in the state but when i highlight it, it doesn't highlight the products in the this.state.
this is just something related to the ide you're using and nothing specific about react. you're passing an object with attributes and most ides (or all (?)) don't connect the combination with this.setstate
to the state object.
Source: stackoverflow.com
Related Query
- setState not updating the state object
- setState call inside a custom hook is not updating the state
- React not updating state with setState with Array of object
- this.setState not updating the state unless I pass the whole object to it
- React: Looping over an object to bind useState functions is not updating the state of my application
- React hooks - setState is not updating the state properties to show sidebar
- useState in react is not updating the state object
- setState is not updating the state even callback
- Redux not updating state correctly -- state stays as empty array despite adding an object in the line prior
- ReactJs : Setstate is not updating the state
- setState is not updating the state
- React setState not updating the state
- React functional component setState not updating the state
- React - updating an object array in the state with setState
- Why is my setState not updating the state or triggering re-render?
- Why does calling react setState method not mutate the state immediately?
- React setState not updating state
- How do I update the state (using ReactJS) if I should not call setState in componentWillUpdate?
- Updating the array object in React state using immutability helper
- Issues with useReducer not synchronously updating the state
- Why is the DOM not updating with state change in ReactJS?
- React componentDidMount not updating the state
- React is not updating when Redux state is changed below the first level
- component not re-rendering when updating the state in mobx
- this.state not the same as state in this object
- Calling setState with nested object does not update state correctly
- setState is not updating state properly
- Updating State | object is not iterable (cannot read property Symbol(Symbol.iterator))
- Why is the state not updating inside this react Hooks component?
- Updating the field of the nested object not re-rendering the views (UI) in React Redux
More Query from same tag
- How to resolve 'this navigator has both navigation and container props' error
- how to output a json image file extension from a react applicaiton
- react-virtualized dynamic table height
- React props between class
- Whats wrong with this inline style ternary
- connecting react frontend with node js rest api
- Redux - Unable to use dispatch to call action inside of axios response
- How to use react-jss within react class Components?
- How do I make the Toast appear?
- React Redux Dispatch Action inside Const
- How can I synchronize data from two different queries, where one is being transformed in useEffect?
- How to change style of a character based on a condition
- ag-grid - Resize detail height when data changes
- Problem with a tutorial about firebase+react
- Render a react.js component with document.write() inside
- Material-ui.Why Popover set Modal's backdrop invisible
- How can i change Fontawesome icons dynamically in React?
- Post Review on product through Amazon SP-API
- How can I get Firebase authentication on initialization with React.js?
- How to append data in array in formdata?
- Update a single value in redux store
- TestUtils get React element rendered in the "root"
- React dynamically add html element with event handler
- Toggling with respect to react hooks doesn't work
- Ternary operator multiple actions in reactjs
- getting Not found page on every page at buttom React js
- Facing event depreceated error in Javascript. Can anyone suggest what to do?
- Accordion closes when I change value of a form within it
- Using browserHistory.push to change Route dynamically doesn't work with react-router v4
- How to take screenshot of a particular div in react js ? I have used "use-screenshot-hook" package but it is taking the screenshot of whole page