purescript-react / purescript-react-basic

An opinionated set of bindings to the React library, optimizing for the most basic use cases
https://pursuit.purescript.org/packages/purescript-react-basic
Apache License 2.0
281 stars 40 forks source link

Docs: toReactComponent doesn't exist (anymore) #129

Closed andys8 closed 4 years ago

andys8 commented 4 years ago

There is a reference to toReactComponent. It doesn't exist anymore. Not sure by what it was replaced ;)

https://github.com/lumihq/purescript-react-basic/blob/3569fea76dcd776baceda071a6f6286befb92142/src/React/Basic.purs#L70

megamaddu commented 4 years ago

It's over here now: https://github.com/lumihq/purescript-react-basic-classic/blob/main/src/React/Basic/Classic.purs#L280

The implementation was split out so you can leave it out if you're using hooks or make a new one. Also makes it easier it update implementations without requiring version bumps across the whole react-basic ecosystem.

andys8 commented 4 years ago

Ah, thank you very much.

I was looking at react-basic-hooks where ReactComponent is re-exported.:

https://pursuit.purescript.org/packages/purescript-react-basic-hooks/6.1.0/docs/React.Basic.Hooks#t:ReactComponent

What I actually needed/wanted is reactComponent and it took me some time to figure out, I had run the effect to be able to import and use it JavaScript land :)

So, I'm looking forward to docs. The library is looking pretty neat :)

andys8 commented 4 years ago

I guess the docs are fine then 😌

megamaddu commented 4 years ago

Ahh, yes, that could probably be clearer. Planning to have some JS React component interop examples in the shared documentation soon.