Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloneElement in the modal is broken #60

Open
Felixmurithi opened this issue Apr 8, 2024 · 1 comment
Open

cloneElement in the modal is broken #60

Felixmurithi opened this issue Apr 8, 2024 · 1 comment

Comments

@Felixmurithi
Copy link

Felixmurithi commented Apr 8, 2024

Using cloneElement in the modal Open component causes a bug unexpectedly

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

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


**This below code doesnt not work,**

<Modal.Open opens="delete">
{status === "checked-out" && (
Delete Booking
)}
</Modal.Open>


**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
Copy link

Is your issue still resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants