Skip to content

feat: document ref for self-referencing #960

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

czabaj
Copy link

@czabaj czabaj commented Jan 3, 2025

I encountered a problem with valid JS code that was hard to translate into rescript - the problem is discussed here in the forum - it turned out the ref can help with self-referencing.

I promised to add this trick to the documentation, so here it is. Feel free to criticize 😸

I currently added it just to the v11 docs, once this passes validation, I will copy that into other versions as well. I assume it is useful for all versions where mutable let assignment exists?

Here is how it renders

Screenshot 2025-01-03 at 12 38 39

Copy link

vercel bot commented Jan 3, 2025

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

A member of the Team first needs to authorize it.

@czabaj czabaj marked this pull request as draft January 3, 2025 11:43
@czabaj czabaj marked this pull request as ready for review January 13, 2025 15:25
@fhammerschmidt
Copy link
Member

Sorry I missed this during my christmas break.

The example seems pretty heavy and we usually try to avoid React-specific code in the main documentation. Can you come up with a simpler example that doesn't need React?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants