Skip to content

Add React interopt guide #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2024
Merged

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Jun 13, 2024

These are some notes on importing existing React components.

Copy link

vercel bot commented Jun 13, 2024

@nojaf is attempting to deploy a commit to the ReScript Association Team on Vercel.

A member of the Team first needs to authorize it.

@nojaf
Copy link
Contributor Author

nojaf commented Jun 15, 2024

@fhammerschmidt any thoughts on this?

Copy link
Member

@fhammerschmidt fhammerschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider wrapping your examples in <CodeTab>s and format them in the playground. Then you can also grab the JS output from there (usually without the noise of imports, many such examples can be found in the codebase).

@fhammerschmidt
Copy link
Member

Also I am currently working on compiling the React examples in tests, so would be nice if you ensure they actually compile in the playground. No need for them to execute though.

@nojaf
Copy link
Contributor Author

nojaf commented Jun 16, 2024

Thanks @fhammerschmidt, this is great feedback!
I used CodeTabs and ensured that everything compiled in the playground.

@fhammerschmidt
Copy link
Member

fhammerschmidt commented Jun 16, 2024

I just had a look at an old PR which basically does the same thing as you here, but they named the chapter Import / Export ReactJS. Also they put it under "main concepts" and not "guides". I think yours would be fitting there as well instead?

Can you steal the naming from there and do what @ryyppy mentioned in his last reply?

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?

@nojaf
Copy link
Contributor Author

nojaf commented Jun 17, 2024

Alright, done!

@fhammerschmidt
Copy link
Member

Superb!

@fhammerschmidt fhammerschmidt merged commit f831d59 into rescript-lang:master Jun 17, 2024
1 of 2 checks passed
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.

2 participants