Closed jhsware closed 2 years ago
Hmm, doing that breaking change aint good idea IMO. It doesnt benefit much, render method in inferno also has nextProps available so its not a big deal
@Havunen what is your take on props having different types for Class Components and Function Components? Fix or don't fix?
componentWillUpdate?(nextProps: Readonly<{ children?: Inferno.InfernoNode } & P>, nextState: S, context: any): void;
onComponentWillUpdate?(lastProps: Readonly<P>, nextProps: Readonly<P>): void;
Props should have children property defined in its type
I think we should add context to onComponentWillUpdate too
Props should have children property defined in its type
Will fix
I think we should add context to onComponentWillUpdate too
Will fix
I'll need a couple of days until I have completed this.
@Havunen I have made the changes EXCEPT adding context to the on[xxx]Update hooks. That change broke tests and they are used both in normal and compat mode. In compat mode we don't send context (since React didn't) and I ran out of time figuring out what to change, so I backed out on the context change.
Great! Can you fix the conflict please :)
@Havunen PR rebased on master. Didn't run prettier at the end because there were many files affected that I haven't worked on. Better to run prettier separately on master.
The typing for animation hooks was incomplete:
componentWillMove
hookHTMLElement | SVGElement
componentWillMove
hook (it is inconsistent with the other hook, props should be referenced usingthis.props
)NOTE: The last change is a BREAKING CHANGE, but I think it is better to fix it now than have it linger. Worth a bump in minor version.
While implementing this I also noted the following inconsistency in typing of argument props:
Where
children?
is only added for class component hooks.Let me know if I should change this.