Closed danilofuchs closed 9 months ago
Do you have this component wrapped in <FlagProvider>
? @danilofuchs
Do you have this component wrapped in
<FlagProvider>
? @danilofuchs
Yes, it is
The issue was, I was importing
import { FlagProvider } from "@unleash/nextjs/client";
import { useUnleashContext } from "@unleash/proxy-client-react";
whilst the correct is to import it from the same place as FlagProvider. Probably something changed in 1.3.0 and the contexts are not the same
CORRECT:
import { FlagProvider, useUnleashContext } from "@unleash/nextjs/client";
Describe the bug
I think it refers to this line of code: https://github.com/Unleash/proxy-client-react/blob/46fa764e20617e83fd060b15f327c83cfa73fa66/src/useUnleashContext.ts#L5
Steps to reproduce the bug
Create a Next.js project (Pages router)
Add the following provider at the _app.tsx file:
Expected behavior
No response
Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
@unleash/nextjs 1.3.0
Subscription type
Open source
Hosting type
Self-hosted
SDK information (language and version)
No response