Just tested it, it behaves as i suspected ;) it doesn't care if the new state is different to the old one. Here's my dummy component for testing. -> opened a new response because codeformating in replies doesn't work a i expect it :)
import react, {Component} from 'react';
export default class DummyComponent extends Component
{
renderCounter;
constructor() {
super();
this.state = {
'test' : 1
};
this.renderCounter = 0;
this.setDummyState = this.setDummyState.bind(this)
}
setDummyState() {
this.setState(
{
'test' : 1
}
)
}
render() {
this.renderCounter = this.renderCounter+1;
return <button className="btn" onClick={this.setDummyState}>{this.renderCounter}</button>
}
}