1

I'm using this lifecycle method componentWillReceiveProps(nextProps, nextContext), but I'm aware that this is a legacy method. I tried to refactor it with static getDerivedStateFromProps(nextProps, nextContext), and find out that I can't access the context.

So my question is what is the new way to pass props and context to update the component?

Chloe Sun
  • 111
  • 1
  • 6

0 Answers0