Closed dca123 closed 2 months ago
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 custom-typings.d.ts
to work around it. The fix can probably work with react 17 also.
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>
Layout v5 is no longer maintained. I am working on the migration to Layout v6 which will fix the issue.
https://mui-treasury.com/?path=/docs/layout-v6-configuration-edge-sidebar--docs
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,