v2.0.0
Instead of modifying the traced component and magically adding new properties to it, the traced component is now more conventionally wrapped by a TracingComponent, and trace and LifecyclePanel are passed as props (underwater the component still needs to be modified to intercept the lifecycle methods though). This gives more control over the constructor, and makes for a more consistent interface. It also makes it much easier to type traceLifecycle, and TypeScript definitions are now included with the package.
Changes
- Traced components are wrapped by a
TracingComponent, which removes the requirement of passingcontexttosuperwhen using an explicit constructor (issue #1) traceandLifecyclePanelare passed as props- TypeScript type definitions are included with the package
- Layout is a little prettier, especially on Windows
- Enzyme tests have been added
Breaking change
- Because
tracecan now be accessed asnextProps.tracein the staticgetDerivedStateFromProps, it is no longer added to theprevStateparameter
Deprecated
this.trace(replaced bythis.props.trace)this.LifecyclePanel(replaced bythis.props.LifecyclePanel)clearInstanceIdCounters(replaced by more appropriately namedresetInstanceIdCounters)
The deprecated versions will continue to work in version 2.x, but generate a warning on the console.