Skip to content

export ThemeContext - #366

Open
abernier wants to merge 1 commit into
pacocoursey:mainfrom
abernier:patch-1
Open

export ThemeContext#366
abernier wants to merge 1 commit into
pacocoursey:mainfrom
abernier:patch-1

Conversation

@abernier

@abernier abernier commented Aug 8, 2025

Copy link
Copy Markdown

Use Case:

in a r3f project, i need to useContextBridge the ThemeContext so the useTheme() can be consumed into my Scene:

// app/App.tsx

'use client'

function App({children}) {
  const ContextBridge = useContextBridge(ThemeContext); // 👈🏻 I need `ThemeContext` HERE
  
  return (
    <ContextBridge>
      <Canvas>
        <Scene />
      </Canvas>
    </ContextBridge>
}

function Scene() {
  const { theme } = useTheme()
  
  return (
    <Box>
      <meshBasicMaterial color={theme === 'light' ? 'red' : 'green'} />
    </Box>
  )
}

thus this PR that just export ThemeContext

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