How to hook up to using @mui/material bindings?

I am trying to hook up a binding to @mui/material/Box but can’t seem to figure it out. I have the following 2 files set up currently.

Box.res

@module("@mui/material/Box") @react.component
external make: React.component<'props> = "default"

Test.res

@react.component
let make = () => {
  <Box> {`test`->React.string} </Box>
}

But I am getting the following error.

  1 │ @react.component
  2 │ let make = () => {
  3 │   <Box> {`test`->React.string} </Box>
  4 │ }
  5 │ 

  The value createElement can't be found in Box

FAILED: cannot make progress due to previous errors.

What am I doing wrong here?

1 Like

Turns out I didn’t have jsx enabled in my rescript.json

  "jsx": {
    "version": 4
  },
3 Likes