Skip to content

Mark all react components as 'use client'#2943

Merged
rajsite merged 2 commits into
mainfrom
react-use-client
Apr 27, 2026
Merged

Mark all react components as 'use client'#2943
rajsite merged 2 commits into
mainfrom
react-use-client

Conversation

@rajsite
Copy link
Copy Markdown
Member

@rajsite rajsite commented Apr 27, 2026

Pull Request

🤨 Rationale

Nimble components rely on running client side so mark all the Nimble / Spright / Ok components with 'use client';

👩‍💻 Implementation

  • Update each file and the icon build script to be marked as use client

🧪 Testing

  • Rely on CI to avoid regressions
  • Manual testing from React Server Components (RSC) and Next.JS users

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@rajsite rajsite marked this pull request as ready for review April 27, 2026 17:13
@rajsite
Copy link
Copy Markdown
Member Author

rajsite commented Apr 27, 2026

@jattasNI bypassing for trivial change to react components. Can address any concerns in follow-up

@rajsite rajsite merged commit 724e1ba into main Apr 27, 2026
11 checks passed
@rajsite rajsite deleted the react-use-client branch April 27, 2026 17:15
@rajsite
Copy link
Copy Markdown
Member Author

rajsite commented Apr 27, 2026

Just capturing some notes, looks like for a next.js hello world one also needs to disable SSR for the Nimble components: https://blog.bitsrc.io/using-non-ssr-friendly-components-with-next-js-916f38e8992c

One way is to do that on import using a next.js specific pattern, not clear to me yet if there is a more generic react server component pattern:

image
'use client'
 
import dynamic from 'next/dynamic'
 
export const NimbleButton = dynamic(() => import('@ni/nimble-react/button').then(mod => mod.NimbleButton), { ssr: false,});
export const NimbleThemeProvider = dynamic(() => import('@ni/nimble-react/theme-provider').then(mod => mod.NimbleThemeProvider), { ssr: false,});

But with the above does seem to work: https://stackblitz.com/edit/nextjs-nimble-nossrimport?file=app%2Fpage.tsx&file=app%2Fnimble.ts

aangerhofer pushed a commit that referenced this pull request May 27, 2026
# Pull Request

## 🤨 Rationale

Nimble components rely on running client side so mark all the Nimble /
Spright / Ok components with [`'use
client';`](https://react.dev/reference/rsc/use-client)

## 👩‍💻 Implementation

- Update each file and the icon build script to be marked as `use
client`

## 🧪 Testing

- Rely on CI to avoid regressions
- Manual testing from React Server Components (RSC) and Next.JS users

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: rajsite <1588923+rajsite@users.noreply.github.com>
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.

1 participant