-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
EdgeTrigger type error #1191
Comments
This is due to @types/react@18. If you use @types/react@17 it works. I would like to know the solution to making it work with 18. |
@rym002 while i've been unable to do a proper fix as the package itself uses react 17, the solution explained above should allow you to patch this. |
I used your fix in a file |
Same problem here, I fixed using: <EdgeTrigger target={{ anchor: 'left', field: 'open' }} sx={{ mr: 2 }}>
{/* @ts-ignore */}
{(open, setOpen) => (
<IconButton color='inherit' edge='start' onClick={() => setOpen(!open)}>
{open ? <ArrowLeft /> : <MenuIcon />}
</IconButton>
)}
</EdgeTrigger> |
Using
<EdgeTrigger>
with typescript results with the following type error on latest mui packages - 5.8.2The tutorial as described asks to install packages as such
yarn add @mui/material@next @mui/icons-material@next @emotion/styled @emotion/react @mui-treasury/layout@next @mui-treasury/mockup@next
which will install the following versions.This type error does not exist for this version.
From what I'm able to understand, the type errors comes from here
My solution that i've patched in has been to omit the child parameter like this
I'm not sure if this is the best solution and I'm open to suggestions. If this looks good, I can start a PR for this.
During the yarn patch process, I also had to change
to
which allowed for the patch to be applied.
Cheers,
The text was updated successfully, but these errors were encountered: