trussworks / react-uswds

USWDS 3.0 components built in React
https://trussworks.github.io/react-uswds/
Apache License 2.0
182 stars 81 forks source link

fix: ‘use client’ directive syntax #2891

Closed sawyerh closed 5 months ago

sawyerh commented 5 months ago

Summary

This fixes usage of the package in a React Server Components environment (Next.js app router). This regression was introduced during the Webpack -> Vite migration.

How To Test

  1. npx create-next-app@latest - select Yes for App Router when you get there
  2. Add a React USWDS component to a page

Screenshots

Before

CleanShot 2024-04-17 at 18 09 53@2x

After

CleanShot 2024-04-17 at 18 08 31@2x

brandonlenz commented 5 months ago

@all-contributors please add @sawyerh for bug

allcontributors[bot] commented 5 months ago

@brandonlenz

I've put up a pull request to add @sawyerh! :tada: