Preact: 10.0.0-alpha.0 - compat cloneElement ignoring props and children

Created on 6 Mar 2019  路  3Comments  路  Source: preactjs/preact

Most helpful comment

@marvinhagemeister Here is a snippet showing a difference between using cloneElement from preact vs from preact/compat https://codesandbox.io/s/34z0lkm6pm

All 3 comments

Can you share some code where the issue can be reproduced? Something like a simple snippet in CodeSandbox helps tremendously in fixing issues.

EDIT: Can confirm this via this test case: https://codesandbox.io/s/y32qooolx9

@marvinhagemeister Here is a snippet showing a difference between using cloneElement from preact vs from preact/compat https://codesandbox.io/s/34z0lkm6pm

Ok, I was able to narrow down the issue to using compat together with createElement from core. Because we're only checking for $$typeof to mark a vnode as valid it seems like we need to allow standard preact vnodes, too. Will investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajaraodv picture rajaraodv  路  3Comments

marcosguti picture marcosguti  路  3Comments

paulkatich picture paulkatich  路  3Comments

philipwalton picture philipwalton  路  3Comments

SabirAmeen picture SabirAmeen  路  3Comments