Skip to content

fix: add necessary 'use client' to components that use client-side APIs#23

Open
sburton84 wants to merge 1 commit into
mainfrom
add-use-client
Open

fix: add necessary 'use client' to components that use client-side APIs#23
sburton84 wants to merge 1 commit into
mainfrom
add-use-client

Conversation

@sburton84
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures GDPR cookie-consent UI modules are treated as Next.js Client Components by adding the required 'use client' directive to files that use client-only React/Next APIs (e.g., useContext, createContext, dynamic client rendering).

Changes:

  • Added 'use client' to the cookie consent hook and shared context module.
  • Added 'use client' to CookieConsentManager and reformatted its dynamic import / JSX return for readability.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
documentation-ui/src/custom/docs/components/gdpr/contexts/useCookieConsent.ts Marks the hook module as a Client Component so useContext usage is valid in Next.js app router.
documentation-ui/src/custom/docs/components/gdpr/contexts/CookieConsentShared.ts Marks the shared context module as client so createContext usage aligns with React Server Components constraints.
documentation-ui/src/custom/docs/components/gdpr/_components/CookieConsentManager/CookieConsentManager.tsx Marks the manager component as client and keeps the client-only dynamic banner rendering properly isolated (SSR disabled).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants