This commit is contained in:
Eric Bailey
2023-12-13 19:07:55 -06:00
parent 5cbb1e6bad
commit 71230f244f
+4 -1
View File
@@ -98,7 +98,10 @@ export function createSystem<
function useStyle(props: ResponsiveStyleProps) {
const {theme} = useTheme()
const breakpoints = useBreakpoints()
return theme.style(props as StylesAndProps, breakpoints.active).styles
return React.useMemo(
() => theme.style(props as StylesAndProps, breakpoints.active).styles,
[breakpoints.active, props, theme],
)
}
function useStyles<O extends Record<string, ResponsiveStyleProps>>(