jonasschmedtmann / ultimate-react-course

Starter files, final projects, and FAQ for my Ultimate React course
3.07k stars 1.88k forks source link

cloneElement in the modal is broken #60

Open Felixmurithi opened 5 months ago

Felixmurithi commented 5 months ago

Using cloneElement in the modal Open component causes a bug unexpectedly

return cloneElement(children, { onClick: () => open(opens) });

This code works <``` Modal.Open opens="delete">

``` **This below code doesnt not work,** ``` {status === "checked-out" && ( )} ``` **I get this error** > Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports However it had been working before I added the **ErrorBoundary library**
yonathandevpro commented 2 weeks ago

Is your issue still resolved?