I am trying to change the state, but it is not working.
This is my state in App.js:
class App extends React.Component {
state = {
one: [
{
id: 1,
sum: "400",
}
],
two: {
title: "test",
number: "0",
}
};
And here is my function:
Change = (value) => {
this.setState({ number: "300" });
But the number does not change. I have also tried:
Change = (value) => {
this.setState({ two.number: "300" });
But this is not working either. Can someone help me?