score:1
just a guess, but check if you use the parameter of the function shouldcomponentupdate and not the "this.prop" or "this.state" from your component. the current props/state will give you the old props/state. the new prosp/state is in the import parameters like nextprops/nextstate.
shouldcomponentupdate: function(nextprops, nextstate) {
return nextprops.id !== this.props.id;
}
Source: stackoverflow.com
Related Query
- redux connecting old states
- React-Redux: Should all component states be kept in Redux Store
- What is the necessity of "export default connect" when you are connecting your react component to redux store
- Redux connect() with multiples actions / states
- React Router 4.x - PrivateRoute not working after connecting to Redux
- Connecting nested Redux smart components with reducers
- Connecting RTK Query API with redux reducer and selector
- Connecting Redux devtools and Thunk middleware to store
- Connecting a component with OwnProps using react redux and typescript in the .NET Core 2.0 reactredux template project
- Fast changing states without Redux
- React Redux - is it ok to throw every state into connecting my components?
- Redux showing old state when a screen is re opened
- Form states in react redux
- Why Redux returns old state when dispatch action before?
- Redux - Making Impossible States Impossible
- Why are default states on redux initialized to false instead of empties?
- How to map multiple states to props by using Redux in React?
- performance: connecting to the Redux store vs passing data through props
- Having trouble wrapping my head around using redux states in React
- React Redux Form: form is submiting with old values
- Can I have a shared 'model' between 2 Redux states / reducers?
- Redux persist gives me undefined states instead of default redux states
- Redux Thunk getState() is returning all states
- Multiple Redux states in a single component - Typescript, React, Redux
- How can I filter data using Redux but keeping the old state?
- Redux mapStateToProps not connecting correctly
- Is there a simple idiomatic way of updating key-value states in Redux reducers
- Websocket event receiving old redux state in React app
- Update the Old and New Value in Redux
- React js - material ui - transfer list -- using old states
More Query from same tag
- Recharts Pie chart .. can pie slice move when selected?
- React dynamic render html
- I need to change the code from class component to function component in react
- How to combine conditions taking different parts of an object as parameter in react.js for CSS
- How to iterate nested object in state to render the values on screen?
- request data from Github api
- How to add new elements to table using ReactJS
- How can you access redux's store from a non-component helper function?
- Issue using render props to create toggle button to show/hide child components
- console.log this.props show undefined but renders correctly on react redux page
- this.handleChange = this.handleChange.bind(this);
- How to know an asynchronous call has finished with redux-saga?
- Add additional props to component in a foreach loop
- React leaflet map get corners lat and long
- Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout
- How To Update the React js project from 15.6 to 16.8?
- JS React: replacing regex with component in a string
- React Router v4 - Cannot read property 'params' of undefined
- Ant Design with sass in React with create-react-app
- React Stateless Functional Components - Laravel
- How to remove lines from Router Link? style={{'textDecoration': 'none'}} is not working
- My React Pagination works very well but search function is not?
- Display array of objects in particular order of heading names in the table
- making nested content take up full width
- Passing data on another page by clicking the row: It shows that data is null
- React js hooks lodash set strange behaviour
- React-router-modal strange behavior - I need two clicks to go back, should be just one
- Material UI- Facing a problem to align the grid to float right
- How to pass two onClick parameters to one function in react
- Perform a loop with filter instead of map