0 votes
in ReactJS by
retagged by
In which of the following condition, the React.js Lifecycle method static getDerivedSateFromProps(props, state) is called?

a) The component is created for the first time.

b) The state of the component is updated.

c) Both of the above.

d) None of the above.

1 Answer

0 votes
by

C is the correct option. In React.js, the static getDerivedSateFromProps(props, state) is called in both cases when a component is created and when a component is updated.

Related questions

0 votes
asked Apr 15, 2022 in ReactJS by Robindeniel
0 votes
asked Apr 15, 2022 in ReactJS by Robindeniel
...