In my first foray into 3rd party bindings installed from npm, and I seem to have run into some trouble! The bindings cannot be found, even though I’ve installed them with yarn: The module or file MaterialUI can’t be found. Here is my work so far:
bsb -init react-material -theme react
cd react-material/
yarn
yarn add wegry/bs-material-ui
yarn add material-ui@next
yarn clean
yarn build
# this much works!
Add a component like:
let component = ReasonReact.statelessComponent("Header");
let make = (_children) => {
...component,
render: (_self) =>
<MaterialUI.AppBar position=`Static color=`Inherit>
<MaterialUI.Toolbar>
<MaterialUI.Typography variant=`Title color=`Inherit>
(ReasonReact.string("Title"))
</MaterialUI.Typography>
</MaterialUI.Toolbar>
</MaterialUI.AppBar>
};
And then rebuild, and I get
The module or file MaterialUI can’t be found.
Here is my bsconfig.json
{
"name": "react-template",
"reason": {
"react-jsx": 2
},
"sources": {
"dir" : "src",
"subdirs" : true
},
"package-specs": [{
"module": "commonjs",
"in-source": true
}],
"suffix": ".bs.js",
"namespace": true,
"bs-dependencies": [
"reason-react"
],
"bs-dev-dependencies": ["bs-material-ui"],
"refmt": 3
}
Note: I added wegry/bs-material-ui instead of InsidersByte/bs-material-ui because wegry has an open PR fixing some reason-react deprecation things.
The bsb -make-world step shows that it’s building the bindings which are in node_modules/bs-material-ui/src/MaterialUI.re
I am new to reasonml, so I may just be misunderstanding how bsb
works.