Skip to content
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

Allow useId in server and shared components #7

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

connor-baer
Copy link
Contributor

Context

The useId hook is the only hook that is allowed in client, server and shared components, which means it doesn't require the use client directive. From the React docs:

Third-party components that use any of the following React APIs must run on the client:

Changes

  • Add an exception for useId. Initially, I tried to amend the regular expression, but a simple string comparison seemed simpler and more performant.

Copy link

changeset-bot bot commented Feb 9, 2024

🦋 Changeset detected

Latest commit: 452d331

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-react-server-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@roginfarrer roginfarrer merged commit c1f4c62 into roginfarrer:main Feb 14, 2024
1 check passed
@roginfarrer
Copy link
Owner

Nice, thanks!

@connor-baer connor-baer deleted the fix/allow-useId branch February 15, 2024 07:48
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.

None yet

2 participants