Open Neftedollar opened 5 years ago
I've checked FunctionComponent.Of
works with simple ReactElements
.
@mvsmal hey! Can you help me with digging it? How do you think where I should start?
Hi. Sorry for the delay. Did you check Simple AppBar example? https://mvsmal.github.io/fable-material-ui/#/demos/app-bar
The problem with withStyles
is that it is a HOC and must be instantiated only once:
let appBarWithStyles = withStyles<IClassesProps> (StyleType.Styles styles) [] appBar
let view () =
ReactElementType.create appBarWithStyles createEmpty []
Another issue might be due to partial application. Your appBar
function should have only one argument props
, which could be any type you want, implementing IClassesProps
.
Unfortunately with the specifics of HOC, it is not suitable for curried functions.
The latest version of MaterialUI utilized the hooks API and fable-materia-ui is not yet supporting MaterialUI v4.x. I am working on it, however the last few months I had no time, unfortunately.
@mvsmal Thank you! But what is HOC? =)
Higher-Order component: https://reactjs.org/docs/higher-order-components.html
@mvsmal thank you! it's very helpful
Hey! Here is syntax for stateful components. And I've tried to use it with component AppBar. Unfortunately, it's not working but compiles.
Fable.Compiler 2.3.3 Fable.MaterialUI (4.1)
here is example
errors in the browser console: