score:1
Accepted answer
i solved this by checking nextprops compared to currentprops and if there was a change in them i then set the state causing a re render.
the reason why the right table (sell orders) didn't update is because there was buy data and sell data coming down the socket. the sell orders going first almost every time (that's why it would work periodically).
because i was not checking if the props changed, the state was getting set multiple times and i was unable to see the style.
componentwillreceiveprops(props) {
if (this.props.data !== props.data) {
this.setstate({previoustable: this.props.data});
}
}
Source: stackoverflow.com
Related Query
- React conditional style not rendering properly
- react button conditional rendering not working properly
- Warning: Functions are not valid as a React child, using a conditional rendering
- React leaflet not rendering properly
- Conditional Rendering in React won't work, state not working properly?
- react jsx inline style not rendering when populated from a variable
- react-bootstrap Navbar not rendering properly in React js
- Css transition not working on conditional rendering in React
- Why is .card-header not rendering properly in my React Bootstrap setup?
- wrote a React code snippet to implement conditional rendering and am not able to update the state of {Left} and {Right}
- React Conditional Rendering of Component Inside Function Not Working
- React nested route page not rendering properly as expected
- React conditional rendering not recognising true from state
- React vis Line Chart not rendering properly
- React Js conditional rendering of html element not working as expected
- Conditional Rendering not working in React mapped loop
- React conditional rendering does not work
- Production React website not rendering properly
- Conditional rendering of CSS style in elements React
- Conditional Rendering is not working in the tbody in react
- React Nav items with conditional render not rendering correctly
- Table not rendering properly inside <div> tag in React
- React Conditional Rendering child on click not working
- wProps updating in react dev tools but conditional jsx not rendering correctly
- Component Not Rendering Properly in React when using CSS hover pseudo selector
- Array Map method not rendering properly in React
- React - Array of images not rendering properly
- If/else conditional rendering of React components not working
- Sorted items of array not rendering properly with react
- React conditional rendering is not giving the expected value (it is not working)
More Query from same tag
- Getting sum of total value from Reduce
- ckfinder showing message “cannot upload file” but still saving in folder
- I can't create a new card with react
- How to concatenate string with JSON in react.js
- Using useState and setting a class accordingly in React
- disable semantic Button in react
- React with Typescript hot reload IIS webserver
- How to re-render a particular component in React with setInterval or there is another way?
- Unexpected use of 'event' getting value of an icon. (ReactJS)
- Material UI strange blue line when overflow attribute is added
- Why my array getting appended instead of clearing and Adding new data
- ComponentDidUpdate() keeps getting called slows the process down (Axios)
- Should I be binding also inbuilt React methods?
- How can I get count of selectable rows?
- How to render modal using ReactDOM.createPortal at application start without causing "Target container is not a DOM element"?
- Moving average of time series objects in Array
- Reactjs prevent unwanted renderings with useCallback and memo
- webview_flutter javascript channel can't communicate in release mode
- react: onClick - get only the clicked element, not the children
- How to add a margin to a datetime picker component?
- React - Form keeps re-rendering component while I type
- Mobx: Calling an action that depends on an observable in a different store, from a React useEffect
- How do I display Images in React from a Django Rest API?
- React - propTypes for parent component rendering a library?
- Get the Value of react redux in the child at the Component that call on React JS
- this.setState is not re rendering button icon
- React - sort array of child components with state
- Make a horizontal bar using react-chartjs-2
- What is best way to do lazy loading in a Next js Application?
- Page goes blank when I try to use a certain component