score:3
Accepted answer
if youre trying to change the categoryList
state with your incoming data you need to change your set state to
this.setState({
categoryList: data,
});
what youre currently doing is adding a state with key data (even though there is no data
key in your getInitialState
function). and since youre not using this.state.data
anywhere, nothing is changing, and so your ui does not appear to be updating
Source: stackoverflow.com
Related Query
- Map of React Components not re rendering on State Change
- React State change is not Rendering
- REACT + REDUX: on redux state change mapStateToProps updating state but view is not rendering as per new state
- React not rendering updated UI on state change
- React component not rendering after state change
- React component not rendering after state change from callback
- React Child Component Not Updating After Parent State Change
- React component not re-rendering on state change
- React Hooks - useEffect fires even though the state did not change
- React shouldComponentUpdate() is called even when props or state for that component did not change
- React leaflet center attribute does not change when the center state changes
- Props not updating when redux state change in React Hooks
- react is not updating functional component state on input change
- react component state change after ajax call but does not rerender component
- Conditional Rendering in React won't work, state not working properly?
- React Child with useEffect() not updating on Parent State Change
- React not re-rendering on state change
- React child component not re-rendering on parent state change
- React - will not re render on state change
- React Js component rendering only once after state change
- React Native ListView not re-rendering on state change by click
- React useCallback does not get updated on state change
- React UI not updating on state change
- React Component not updating with state change
- useContext not updating on state change in React
- React child component do not re-render on it state change
- Change of state is not getting affected in another unmount useEffect in react hooks
- React child component not re-rendering on state change
- react stateless child components do not update on state change in parent component
- functional component is not re-rendering after state change in React
More Query from same tag
- check for never[] in typescript
- React js component, map works, foreach doesn't
- How to hide logo if there is no logo?
- How to POST a JSON with data provided by user with REACTJS and Axios
- React Form onSubmit method not triggered
- declare type with React.useImperativeHandle()
- Proxy API request using React Router
- How to get recurring dates using moment
- React Changing values of drop down according to selected values in other drop-down lists
- Best way to restrict page access?
- MUIDataTable 'customBodyRender' error
- react-bootstrap-typeahead labelKey Typescript
- React Scripts Not Found When Using GoLang http.FileServer
- How to fixed error: "You must pass a component to the function returned by connect. Instead received {}", in my React-Redux app?
- access clicking edit icon in material table
- ReactJS append dynamically columns into rows in image gallery
- why following Ant-Design Syntax not rendering anything?
- Trouble hosting react app at location using docker nginx
- How to get nested reference data at ones from Firestore document?
- Calculating Total sum from a table
- GET API showing KeyError in browser, but working in Postman
- Declaring variables outside of functional React component
- Material UI <TextField/> not Vertical Align with it's Label
- Component is declared but never used
- Replacing an attribute in an array exists, or adding a new attribute pair if not
- Navbar which is used react app made by using bootstrap is not full width
- Handling Null Object Property Value in Component
- Reactjs - Higher Order Component unmount not working correctly
- React Native, how to update view after language change
- Prevent child element from being dragged when parent is draggable