render-props-compose icon indicating copy to clipboard operation
render-props-compose copied to clipboard

Doesn't work in Preact

Open Pyrolistical opened this issue 7 years ago • 1 comments

I ported the demo into Preact: https://codesandbox.io/s/kw9yy439yv

Preact treats children differently. Its always an array https://github.com/developit/preact-compat/issues/366

We make easily make this work for React and Preact by checking if children is an array of length 1 with a function, and pop it out. I'll get PR up

Pyrolistical avatar Jun 08 '18 20:06 Pyrolistical

Sure, PRs are welcome!

gnapse avatar Jun 08 '18 21:06 gnapse