Open
Description
Description
If the config is changing it is not reflecting on the components.
CodeSandbox/Snack link
No response
Steps to reproduce
-
Create 2 configs.
-
Have a state to decide which config to use
-
Based on the state provide a config object:
function ThemedApp({children}: {children: React.ReactNode}): JSX.Element {
const [config, setConfig] = useState("blue")
const themeConfig = useMemo(
() => config === "blue" ? blueConfig : greenConfig ,
[config],
);
return (
{children}
);
} -
Have a button that changes the state (for example between green and blue ) if the green config has primary color as green and blue config primary color as blue then it is not applying it is stuck on initial ( which is blue in this case )
gluestack-ui Version
1.0.17
Platform
- Expo
- React Native CLI
- Next
- Web
- Android
- iOS
Other Platform
No response
Additional Information
A simple code example:
import {Button} from "@gluestack-ui/themed"
import {blueConfig, greenConfig} from "./config"
function ThemedApp({children}: {children: React.ReactNode}): JSX.Element {
const [config, setConfig] = useState("blue")
const themeConfig = useMemo(
() => config === "blue" ? blueConfig : greenConfig ,
[config],
);
return (
<GluestackUIProvider config={themeConfig} colorMode="light">
{children}
<Button onPress={()=>{
setConfig(prev=>prev==="blue" ? "green" : "blue")
}}>Change config</Button>
</GluestackUIProvider>
);
}
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog