alexmingoia / purescript-pux

Build type-safe web apps with PureScript.
https://www.purescript-pux.org
Other
565 stars 76 forks source link

Update using-pux-components-in-react.md #55

Closed kurtharriger closed 8 years ago

kurtharriger commented 8 years ago

The import syntax has apparently changed in 0.9 I was getting the error UnknownName on Pux.toReact I could add it to the explicit imports, but then I needed to change my function from toReact to mkReact or something like that to avoid a naming conflict.

ReactClass is not re-exported from Pux namespace so I needed to update this import as well.

Also it appears PS.Counter.toReact(state) returns a function not a React class, so I suggested maybe changing const Counter = PS.Counter.toReact(state) to const Counter = PS.Counter.toReact(state)()?
I'm still very new to purescript and I'm guessing that perhaps there is a better way to do this so that toReact returns a value instead but I couldn't seem to figure it out in this context.