We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b397195 commit c8740a7Copy full SHA for c8740a7
src/traceLifecycle.jsx
@@ -54,6 +54,10 @@ export default function traceLifecycle(ComponentToTrace) {
54
constants.DEPRECATED_THIS_TRACE,
55
props.trace
56
);
57
+ if (!isLegacy && typeof this.state === 'undefined') {
58
+ this.state = {};
59
+ // Initialize state if it is undefined, otherwise the addition of getDerivedStateFromProps will cause a warning.
60
+ }
61
}
62
63
componentWillMount() {
0 commit comments