Answer the question
In order to leave comments, you need to log in
Is it possible and how to use inheritance in React?
Good afternoon, dear connoisseurs. The question is:
Is it possible to inherit components from each other in React? It turns out that almost every component has a method:
componentWillReceiveProps(nextProps) {
if (nextProps.val != this.state.val) {
this.setState({val: nextProps.val});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question