Is getDerivedStateFromProps Ready?


(Aaron Lote) #1

I’m currently using 16.4.0 and it doesn’t seem like getDerivedStateFromProps is being triggered in my test component.

Is it actually in the codebase yet?


(Thomas) #2

It works for me. The function should be static though.

static getDerivedStateFromProps(nextProps, prevState) { console.log('getDerivedStateFromProps()'); return null; }