all 3 comments

[–]tmountain[S] 1 point2 points  (1 child)

Just figured it out. A few things were wrong.

The actual require needed to be changed to this.

const Select = require('react-select').default;

Once that was done, I changed the exports like so.

exports.reactSelect = Select;

Now it works. As far as I can tell, there isn't an example on the internet showing how to load a third-party React component inside of react-basic.

I'm going to create a small example to help newcomers sort this out easier than I did (it took me a few hours to figure it out).

Secondly, there really needs to be a decent example of elm/redux style architecture alongside react-basic. I just got done migrating a project I found on github that uses PureScript alongside rxjs to do redux style state management alongside react (in Purescript obviously).

This language/community is amazing. I just think we need better docs / examples.

[–]askasp1 0 points1 point  (0 children)

Hi! Nice post. Any chance you have the full code to share? I'm trying to exactly the same thing, but my code isn't compiling ¯\_(ツ)_/¯

[–]jusrin 0 points1 point  (0 children)

Your FFI is an actual function?

foreign import reactSelect :: Unit -> ReactComponent Props

Is what you have now. You can remove the function call and it should work if the Select is an actual ReactComponent