I followed the advice in .html#gradual-migration-path and after upgrading to React 16.3.2 I wanted to rename all our soon to be deprecated lifecycle methods to their UNSAFE_
equivalents.
However I noticed that UNSAFE_ponentWillReceiveProps
is not called at all. When I change it back to ponentWillReceiveProps
it works. Any ideas why?
class Chart extends React.Component<ChartProps> {
chartContainer: SVGSVGElement;
tooltip: HTMLDivElement;
xScale: ScaleBand<string>;
yScale: ScaleLinear<number, number>;
UNSAFE_ponentWillReceiveProps(nextProps: Props) {
...
}
...
}
I followed the advice in https://reactjs/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path and after upgrading to React 16.3.2 I wanted to rename all our soon to be deprecated lifecycle methods to their UNSAFE_
equivalents.
However I noticed that UNSAFE_ponentWillReceiveProps
is not called at all. When I change it back to ponentWillReceiveProps
it works. Any ideas why?
class Chart extends React.Component<ChartProps> {
chartContainer: SVGSVGElement;
tooltip: HTMLDivElement;
xScale: ScaleBand<string>;
yScale: ScaleLinear<number, number>;
UNSAFE_ponentWillReceiveProps(nextProps: Props) {
...
}
...
}
Share
Improve this question
edited May 1, 2018 at 10:34
Július Retzer
asked May 1, 2018 at 10:23
Július RetzerJúlius Retzer
1,0751 gold badge11 silver badges25 bronze badges
1 Answer
Reset to default 6I found the issue. react-dom
package needs to be upgraded to 16.3.2 version as well.