cca-io / rescript-mui

ReScript bindings for MUI
MIT License
255 stars 52 forks source link

ScopedCssBaseline doesn't work #181

Closed FilipKittnar closed 1 year ago

FilipKittnar commented 2 years ago

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 commented 2 years ago

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"
fhammerschmidt commented 2 years ago

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

cknitt commented 2 years ago

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

fhammerschmidt commented 1 year ago

This is fixed in version 5. Closing...