From 5db25ae5eb995cb00924dc9ab09c830a4739533b Mon Sep 17 00:00:00 2001 From: Salem Mohammed Shamakh <58360393+salemkode@users.noreply.github.com> Date: Sun, 28 Sep 2025 03:46:03 +0000 Subject: [PATCH 1/3] fix: enhance UnwrapRecursiveArray to support maximum depth limit --- src/utilities/dot-notation.types.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/utilities/dot-notation.types.ts b/src/utilities/dot-notation.types.ts index 7ce82ea6..b984c722 100644 --- a/src/utilities/dot-notation.types.ts +++ b/src/utilities/dot-notation.types.ts @@ -29,9 +29,16 @@ export type StyleProp = // ---------- Type Helpers ---------- // Unwrap nested arrays (from RecursiveArray) -type UnwrapRecursiveArray = T extends (infer I)[] - ? UnwrapRecursiveArray - : T; +type UnwrapRecursiveArray< + T, + Depth extends unknown[] = [], + MaxDepth extends number = 10 +> = Depth["length"] extends MaxDepth + ? T // إذا وصلنا للحد الأقصى نوقف + : T extends (infer I)[] + ? UnwrapRecursiveArray + : T; + // Remove null, false, undefined, etc. type RemoveFalsy = Exclude; From 804d3cd4b17d10270f5dbac003915c1e6141639e Mon Sep 17 00:00:00 2001 From: Salem Mohammed Shamakh Date: Sun, 28 Sep 2025 14:34:02 +0300 Subject: [PATCH 2/3] chore: use ComponentPropsWithRef in styled utility --- src/web/api.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/api.tsx b/src/web/api.tsx index d0ff6e22..c8ff3422 100644 --- a/src/web/api.tsx +++ b/src/web/api.tsx @@ -1,7 +1,7 @@ import { createElement, useMemo, - type ComponentProps, + type ComponentPropsWithRef, type PropsWithChildren, } from "react"; import { Appearance } from "react-native"; @@ -25,7 +25,7 @@ export const styled = < mapping: M, _options?: StyledOptions, ) => { - return (props: StyledProps, M>) => { + return (props: StyledProps, M>) => { return useCssElement(baseComponent, mapping, props); }; }; From 3ab22f0f8535d5ef73c729c8e2bc8a9ec45ac934 Mon Sep 17 00:00:00 2001 From: Salem Mohammed Shamakh <58360393+salemkode@users.noreply.github.com> Date: Sun, 28 Sep 2025 14:43:35 +0300 Subject: [PATCH 3/3] Apply suggestions from code review --- src/utilities/dot-notation.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/dot-notation.types.ts b/src/utilities/dot-notation.types.ts index b984c722..6700a21a 100644 --- a/src/utilities/dot-notation.types.ts +++ b/src/utilities/dot-notation.types.ts @@ -34,7 +34,7 @@ type UnwrapRecursiveArray< Depth extends unknown[] = [], MaxDepth extends number = 10 > = Depth["length"] extends MaxDepth - ? T // إذا وصلنا للحد الأقصى نوقف + ? T : T extends (infer I)[] ? UnwrapRecursiveArray : T;