In which of the following condition, the React.js Lifecycle method static getDerivedSateFromProps(props, state) is called?

Q & ACategory: React JSIn which of the following condition, the React.js Lifecycle method static getDerivedSateFromProps(props, state) is called?
Admin Staff asked 2 years ago

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 Answers
Admin Staff answered 2 years ago

c) Both of the above.