rescript-mui icon indicating copy to clipboard operation
rescript-mui copied to clipboard

ScopedCssBaseline doesn't work

Open FilipKittnar opened this issue 3 years ago • 3 comments

Hello, When trying to use the ScopedCssBaseline module, I get runtime error:

Attempted import error: 'ScopedCssBaseline' is not exported from '@material-ui/core' (imported as 'Core').

FilipKittnar avatar Dec 15 '21 15:12 FilipKittnar

This seemed to help:

@react.component @module("@material-ui/core/ScopedCssBaseline")
external make: (
  ~children: React.element=?,
  ~classes: Mui.ScopedCssBaseline.Classes.t=?,
  ~className: string=?,
  ~id: string=?,
  ~style: ReactDOM.Style.t=?,
  ~key: string=?,
  ~ref: ReactDOM.domRef=?,
) => React.element = "default"

FilipKittnar avatar Dec 15 '21 15:12 FilipKittnar

The problem here is, that it is not re-exported in this file.

They only fixed that in v5, unfortunately: https://github.com/mui-org/material-ui/pull/21869/files

fhammerschmidt avatar Dec 15 '21 16:12 fhammerschmidt

Maybe we can patch the MUI sources before the code generation step?

cknitt avatar Dec 23 '21 11:12 cknitt

This is fixed in version 5. Closing...

fhammerschmidt avatar Jun 16 '23 09:06 fhammerschmidt