gluestack

gluestack Logogluestack

Stack navigator blocks tokens from gluestack provider

dafevor posted this in #support
Open in Discord
Avatar
dafevorOP
Despite of the fact that stack navigator is wrapped by gluestack provider no rendered screen receives the color tokens from gluestack-ui-config.
<GluestackUIProvider config={config}>
  <NavigationContainer>
      <Stack.Navigator>
        <Stack.Group>
            <Stack.Screen name={someName} component={MyComponent} />
        </Stack.Group>
      </Stack.Navigator>
  </NavigationContainer>
</GluestackUIProvider>

//////////////////////////
<MyComponent backgroundColor="$white" $focus-backgroundColor="$red"></Component>
//////////////////////////

MyComponent is not able to receive color tokens from gluestack provider. Please, suggest a solution for it.
Image

8 Replies

Avatar
sravankumar101
hey @dafevor I've checked this same usecase , it worked for me.Please share your repo here.
And also , if you are starting out please start with gluestack-ui v2 directly.
Avatar
dafevorOP
Something weird is happening, If I define the component directly under the provider it takes the color tokens, but my monorepo has all those UI components defined outside from apps.tsx file in another library/folder, so they are not taking those tokens, despide of the fact the they are added under the provider
 
-apps
    -myApp
        -App.tsx --> if I define MyComponent directly here it takes the tokens
-libs 
    -ui
        -components
            -MyComponent --> here not!
Avatar
sravankumar101
hey @dafevor Could you please share the repo here ?
Avatar
dafevorOP
Oh, I can not share it. it's a private company repo. I think I will need some more time to discover what happens.
Avatar
viraj1098
Hey @dafevor , If you can please send a minimal reproduction of this issue. It's hard to debug from just a error.