Skip to content

Creating a wrapper component for SupaProvider throws errors #18

Description

@yasodhadollu

Creating a wrapper component and using it in the nextjs layout, it throws errors.

export function FeatureFlagProvider({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <SupaProvider config={config}
      {children}
    </SupaProvider>
  )
}

Error:

const context = useContext(SupaContext)
   if (!context) {
     throw new Error('useFeatureContext must be used within a SupaProvider')
          ^
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions