preact-render-to-string icon indicating copy to clipboard operation
preact-render-to-string copied to clipboard

Add support for mixed rendering

Open Saegrov opened this issue 8 years ago • 2 comments

Mixed rendering is a mode that works like shallow rendering, but where you can specify a list of components you want to render even tho they are deeply nested.

We have a use case where we are using shallow rendering and Cheerio for unit testing our Preact components. We are using a redux-connect like higher order component to connect some components to our global state. When testing a component, that uses another component that is wrapped in a HOC, the shallow renderer stops at the HOC.

With mixed rendering we can white list components we want to render and test that the wrapped components are used correctly.

Saegrov avatar Sep 27 '17 10:09 Saegrov

@developit I've updated the PR, but kept the unit tests in a separate file. Do you want me to move them as well?

Saegrov avatar Oct 17 '17 08:10 Saegrov

Hi @Saegrov! Sorry for the delay - happy to have the unit tests in their own file. I think this should be good to merge, just need to check the file size.

developit avatar Aug 02 '18 02:08 developit