BBC-archive / enzyme-adapter-inferno

Inferno enzyme adapter
Other
16 stars 3 forks source link

Proposal: Add support for shallow rendering #15

Open IgnusG opened 6 years ago

IgnusG commented 6 years ago

Inferno adapter could replace the contents of the component with null which prevents its rendering.

It could then redirect methods which try accessing its internal props, state ... to the host node instead of the rendered nodes (which would be null).

I'm not sure about the implications to lifecycle methods though. Theoretically inferno unmounts a component once it returns null so I would suspect componentWillUnmount and/or componentDidMount not firing predictably.

Have to cross-check with preacts adapters

eddyerburgh commented 6 years ago

I'm happy to take a PR for this, but I won't work on this myself.

IgnusG commented 6 years ago

No worries, mostly putting it here so I don’t forget the approach. I’m gonnna try implementing it later