Using Rescript/ReasonML with react library

I want to use Rescript/ReasonML with the react library Material UI. I am having to include each react component as such:

module Card = {
  [@bs.module "@material-ui/core/Card"] [@react.component]
  external make: (~className: string=?, ~variant: string=?, ~children: React.element) =>
    React.element = "default";
};

It’s a lot of work as each component has different attributes.

  1. Am I doing this correctly? Or is there an easier way?
  2. Material UI is a very popular react library for Material Design. Maybe someone else already has done this work. Do you know if that is the case?

There is bs-material-ui by @jsiebern

2 Likes

I tried bs-material-ui but I get the following error when showing any material-ui component (I am not showing a Popper):
load.js:8 GET http://localhost:8000/moduleserve/mod/node_modules/@material-ui/core/Popper/Popper/__mod/popper 404 (Not Found)

What dev setup are you using? This looks more like a js land based problem, but I’m happy to try reproduce.