Skip to content

Commit e539192

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/comment-json-4.3.0
2 parents eba9006 + 2d3e69a commit e539192

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/utilities/dot-notation.types.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ export type StyleProp<T> =
2929
// ---------- Type Helpers ----------
3030

3131
// Unwrap nested arrays (from RecursiveArray)
32-
type UnwrapRecursiveArray<T> = T extends (infer I)[]
33-
? UnwrapRecursiveArray<I>
34-
: T;
32+
type UnwrapRecursiveArray<
33+
T,
34+
Depth extends unknown[] = [],
35+
MaxDepth extends number = 10
36+
> = Depth["length"] extends MaxDepth
37+
? T
38+
: T extends (infer I)[]
39+
? UnwrapRecursiveArray<I, [...Depth, unknown], MaxDepth>
40+
: T;
41+
3542

3643
// Remove null, false, undefined, etc.
3744
type RemoveFalsy<T> = Exclude<T, Falsy>;

src/web/api.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
createElement,
33
useMemo,
4-
type ComponentProps,
4+
type ComponentPropsWithRef,
55
type PropsWithChildren,
66
} from "react";
77
import { Appearance } from "react-native";
@@ -25,7 +25,7 @@ export const styled = <
2525
mapping: M,
2626
_options?: StyledOptions,
2727
) => {
28-
return (props: StyledProps<ComponentProps<C>, M>) => {
28+
return (props: StyledProps<ComponentPropsWithRef<C>, M>) => {
2929
return useCssElement(baseComponent, mapping, props);
3030
};
3131
};
@@ -93,7 +93,7 @@ export function VariableContextProvider(
9393
) {
9494
const style = useMemo(() => {
9595
return {
96-
display: "content",
96+
display: "contents",
9797
...Object.fromEntries(
9898
Object.entries(props.value).map(([key, value]) => [
9999
key.startsWith("--") ? key : `--${key}`,

0 commit comments

Comments
 (0)