I have a react component that receives props from the redux store every second. The new state has an array that\'s different than the last array. To be specific, every second an
PureComponent will shallowly compare the props and state. So my guess here is that the items are somehow new objects than the previous passed props, thus the rerendering.
I would advice, in general, to only pass primitive values in pure components :
class MyList extends Component {
render() {
return (
{this.props.myList.map((item, index) => (
//or it's alternative
))}
);
}
}
//...
class MyRow extends PureComponent {
render() {
const {id, name} = this.props;
return (
{id} - {name}
);
}
}