Skip to content

Commit

Permalink
fix: export styles provider the common way
Browse files Browse the repository at this point in the history
  • Loading branch information
TimKolberger committed Mar 21, 2021
1 parent 9dec9c3 commit 3625298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/giant-seahorses-laugh.md
@@ -0,0 +1,6 @@
---
"@chakra-ui/system": patch
---

- Fixed an issue where the StylesProvider export was not working in every
environment
5 changes: 2 additions & 3 deletions packages/system/src/providers.tsx
Expand Up @@ -52,13 +52,12 @@ export function useTheme<T extends object = Dict>() {
return theme as WithCSSVar<T>
}

export const [StylesProvider, useStyles] = createContext<
Dict<SystemStyleObject>
>({
const [StylesProvider, useStyles] = createContext<Dict<SystemStyleObject>>({
name: "StylesContext",
errorMessage:
"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` ",
})
export { StylesProvider, useStyles }

/**
* Applies styles defined in `theme.styles.global` globally
Expand Down

0 comments on commit 3625298

Please sign in to comment.