react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

BooleanField props TrueIcon or FalseIcon is not working with latest @mui/icons-material

Open MBach opened this issue 1 year ago • 1 comments

What you were expecting: The admin to start normally.

What happened instead: When upgrading my dependencies in package.json, from

    "@mui/icons-material": "5.6.2"

to

    "@mui/icons-material": "5.10.3"

the admin is not launching anymore.

Steps to reproduce: Upgrade dependencies

Related code:

import { Block, Check } from '@mui/icons-material'

const AccountList = (props: ListProps) => {
  return (
    <List
      {...props}
      title={'List of users'}
      filters={AccountFilters()}
      sort={{ field: 'id', order: 'DESC' }}>
      <Datagrid bulkActionButtons={false}>
        <TextField source="id" />
        <BooleanField source="isBlocked" TrueIcon={Block} FalseIcon={Check} />
      </Datagrid>
    </List>
  )
}

Environment

  • React-admin version: 4.3.0
  • React version: 17.0.2
  • Browser: latest Firefox
  • Stack trace (in case of a JS error):
TS2322: Type 'Element' is not assignable to type 'OverridableComponent<SvgIconTypeMap<{}, "svg">> & { muiName: string; }'.
  Type 'ReactElement<any, any>' is not assignable to type 'OverridableComponent<SvgIconTypeMap<{}, "svg">>'.
    Type 'ReactElement<any, any>' provides no match for the signature '<C extends ElementType<any>>(props: { component: C; } & { children?: ReactNode; classes?: Partial<SvgIconClasses> | undefined; color?: "disabled" | ... 8 more ... | undefined; ... 6 more ...; viewBox?: string | undefined; } & CommonProps & DistributiveOmit<...>): Element'.

MBach avatar Aug 31 '22 10:08 MBach

I just check in the simple demo and it works fine by upgrading to "@mui/icons-material": "5.10.3". booleanfield

Could you produce a codesandbox to reproduce the issue?

WiXSL avatar Sep 01 '22 11:09 WiXSL

No news for some time. closing. If you find a way to reproduce this problem, please be sure to let us know by following the issue template

WiXSL avatar Oct 15 '22 17:10 WiXSL