From 929417e7ed58fdf0b5d93613c19b160c2f4e583e Mon Sep 17 00:00:00 2001 From: Divine Niiquaye Ibok Date: Sat, 6 Dec 2025 08:05:36 +0000 Subject: [PATCH 1/2] fix: react compiler auto-memoization in native components useStyle --- packages/uniwind/src/components/native/useStyle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uniwind/src/components/native/useStyle.ts b/packages/uniwind/src/components/native/useStyle.ts index ea3278d4..b41ea9d6 100644 --- a/packages/uniwind/src/components/native/useStyle.ts +++ b/packages/uniwind/src/components/native/useStyle.ts @@ -11,7 +11,7 @@ export const useStyle = (className?: string, state?: ComponentState) => { const [_, rerender] = useReducer(() => ({}), {}) const styleState = useMemo( () => className ? UniwindStore.getStyles(className, state) : emptyState, - [className, _, state?.isDisabled, state?.isFocused, state?.isPressed], + [className, _, state], ) useEffect(() => { From cf4c3233ed199c5c9f30ba1ce0c0b74eb40e8ba7 Mon Sep 17 00:00:00 2001 From: Divine Niiquaye Ibok Date: Mon, 8 Dec 2025 08:47:04 +0000 Subject: [PATCH 2/2] fix: update useStyle to use specific state properties --- packages/uniwind/src/components/native/useStyle.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/uniwind/src/components/native/useStyle.ts b/packages/uniwind/src/components/native/useStyle.ts index b41ea9d6..8ca724f3 100644 --- a/packages/uniwind/src/components/native/useStyle.ts +++ b/packages/uniwind/src/components/native/useStyle.ts @@ -10,8 +10,15 @@ const emptyState = { styles: {} as RNStyle, dependencies: [] as Array { const [_, rerender] = useReducer(() => ({}), {}) const styleState = useMemo( - () => className ? UniwindStore.getStyles(className, state) : emptyState, - [className, _, state], + () => + className + ? UniwindStore.getStyles(className, { + isDisabled: state?.isDisabled, + isFocused: state?.isFocused, + isPressed: state?.isPressed, + }) + : emptyState, + [className, _, state?.isDisabled, state?.isFocused, state?.isPressed], ) useEffect(() => {