Answer the question
In order to leave comments, you need to log in
How to copy a variable in React in componentDidMount?
componentDidMount() {
this.setState({
x: 1
y: 2
z: x-y
})
}
Answer the question
In order to leave comments, you need to log in
Traditionally, to a poorly formulated question, a deliberately useless answer is:
componentDidMount() {
this.setState({
x: 1
y: 2
z: 1-2
})
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question