I am trying to update the set the states onClick
method
constructor(props) {
super(props);
this.state = {
from: 'a',
to: 'b',
};
this.previousClick = this.previousClick.bind(this);
}
previousClick() {
var currDate = '1';
let toDate = '2';
console.log(currDate, toDate);
this.setState = ({
from: this.currDate,
to: this.toDate,
});
console.log(this.state);
}
It is still showing the 'a'
and 'b'