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

Support React server components #232

Closed
sawyerh opened this issue Nov 8, 2023 · 1 comment
Closed

Support React server components #232

sawyerh opened this issue Nov 8, 2023 · 1 comment
Labels
feature New feature or request

Comments

@sawyerh
Copy link
Contributor

sawyerh commented Nov 8, 2023

Blockers

This is blocked if we want to continue using @trussworks/react-uswds. There is a ticket on the @trussworks/react-uswds repo tracking the issue: trussworks/react-uswds#2540

Details

The template currently uses the @trussworks/react-uswds package for providing React versions of the U.S. Web Design System's components. The current implementation of that package makes it incompatible with React server components.

To use the package with the Next.js App Router today, every page would need to include the "use client" directive, which means the template wouldn't be capable of providing the benefits of React server components:

  • Server Components can reduce the amount of code sent and run by the client. Only Client modules are bundled and evaluated by the client.
  • Server Components benefit from running on the server. They can access the local filesystem and may experience low latency for data fetches and network requests.

Additional resources

@sawyerh sawyerh added bug Something isn't working triage New issue which needs reviewed by a maintainer feature New feature or request and removed triage New issue which needs reviewed by a maintainer bug Something isn't working labels Nov 8, 2023
@sawyerh sawyerh changed the title @trussworks/react-uswds can't be used in a React server component Support React server components Nov 8, 2023
@sawyerh sawyerh added this to the Next.js App Router milestone Nov 8, 2023
@sawyerh
Copy link
Contributor Author

sawyerh commented Nov 29, 2023

Fixed in trussworks/react-uswds#2656

@sawyerh sawyerh closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant