Skip to content

Conversation

@mdmower-csnw
Copy link

Summary

Update ref-like name regex to detect x_ref as a ref, similar to xRef.

How did you test this change?

A test fixture has been added to verify that custom_ref is detected as a ref when used in a useCallback hook.

Update ref-like name regex to detect `x_ref` as a ref, similar to
`xRef`.
@meta-cla meta-cla bot added the CLA Signed label Nov 14, 2025
@mdmower-csnw
Copy link
Author

@gsathya - is this something you would be willing to consider as a small flexibility improvement on #29916?

Copy link
Member

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

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

I think we'd have to make this an extra feature flag. At Meta, we follow a convention of pascal case for regular JS variables and snake case for things that come from GraphQL, so -_ref is generally not a React ref.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants