← React Intermediate Questions - Set 11 Q104

What is `getDerivedStateFromProps`?

React Intermediate Questions - Set 11

Example

static getDerivedStateFromProps(props, state) {
  return props.value !== state.value ? { value: props.value } : null;
}

What to notice

← Back to the question list