We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you use createTheme() inside a HOC and then change the values - the theme doesn't update:
createTheme()
export const ProjectProvider = ({ customTheme }: {customTheme: ConfigType.Theme}) => { const theme = createTheme('custom-theme', customTheme); return ( <ProjectContext.Provider value={{ something: '' }}> <div className={theme}> {children} </div> </FrostbyteContext.Provider> ); }
function App() { const [customTheme, setCustomTheme] = useState(); //useState functionality that changes customTheme values (like colors) return ( <ProjectProvider customTheme={customTheme}> ... </ProjectProvider> ); }
Using reset() before createTheme() which is returned from createStitches() does fix the issue:
reset()
createStitches()
export const { styled, getCssText, globalCss, createTheme, theme, reset } = createStitches(defaultStyles);
reset(); //this makes the values update const theme = createTheme('custom-theme', customTheme);
I only found out about reset by looking at the stitches declaration file
there's nothing in the docs about it:
Is reset being used correctly here? Should it not be described in the docs?
thanks - i love stitches btw, amazing work
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If you use
createTheme()
inside a HOC and then change the values - the theme doesn't update:Using
reset()
beforecreateTheme()
which is returned fromcreateStitches()
does fix the issue:I only found out about reset by looking at the stitches declaration file
there's nothing in the docs about it:
Is reset being used correctly here? Should it not be described in the docs?
thanks - i love stitches btw, amazing work
The text was updated successfully, but these errors were encountered: