Skip to content

Conversation

@traviskaufman
Copy link

@traviskaufman traviskaufman commented Nov 25, 2021

There is currently no documentation showing how to import an external react component into ReScript. This commit adds one, adopting an example from https://forum.rescript-lang.org/t/use-reactjs-components-in-rescript-react-project/1992

Example

http://localhost:3000/docs/manual/latest/import-from-export-to-js#import-a-react-component

image

@traviskaufman
Copy link
Author

Just wondering if anybody's gotten a chance to look at this? I know you're all busy and I appreciate you taking the time to take a look ❤️

@ryyppy
Copy link
Member

ryyppy commented Jan 4, 2022

Sorry for the delay... Nov / Dec was quite busy and we all tuned down our hours to get some rest.

This example should probably go into the rescript-react docs section; ... maybe more prominent by introducing a new JavaScript Interop section in the rescript-react navigation as well

There is currently no documentation showing how to import an external react component into ReScript. This commit adds one, adopting an example from https://forum.rescript-lang.org/t/use-reactjs-components-in-rescript-react-project/1992
@traviskaufman
Copy link
Author

No worries at all :) Done!
image

Lmk what you think.

@ryyppy
Copy link
Member

ryyppy commented Jan 24, 2022

Wonderful! thanks for that.

I will be damned, but after looking at the test deployment, I don't know why I suggested JavaScript Interop, since this terminology is completely inconsistent with the rest of the docs.

Maybe good for discussion: What if we called it Import / Export ReactJS? That way we could also give some example on how to consume a ReScript/React component on the JS side?

So instead of javascript-interop, call it import-export-reactjs and give another example for the export part?

Sorry if I am so nitpicky with that one. Changes on the filesystem level are usually breaking changes, and this needs to be right on the first try :)

@fhammerschmidt
Copy link
Member

Superseded by #886

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants