= {
diff --git a/src/runtime.types.ts b/src/runtime.types.ts
index 69cab6ca..649ac2c7 100644
--- a/src/runtime.types.ts
+++ b/src/runtime.types.ts
@@ -31,7 +31,7 @@ export type StyledReactElement<
: M[K] extends true | string | object
? K
: never
- : never]?: string;
+ : never]?: string | undefined;
}
>;
@@ -42,7 +42,7 @@ export type StyledProps> = P & {
: M[K] extends true | string | object
? K
: never
- : never]?: string;
+ : never]?: string | undefined;
};
export interface Styled {
@@ -50,7 +50,9 @@ export interface Styled {
component: C,
mapping?: undefined,
options?: StyledOptions,
- ): ComponentType & { className?: string }>;
+ ): ComponentType<
+ ComponentPropsWithRef & { className?: string | undefined }
+ >;
>(
component: C,
mapping: M & StyledConfiguration,
@@ -69,7 +71,7 @@ type StyledComponent<
: M[K] extends true | string | object
? K
: never
- : never]?: string;
+ : never]?: string | undefined;
}
>;
@@ -88,27 +90,32 @@ interface StyledConfigurationObject<
T extends ComponentPropsDotNotation | false,
> {
target: T;
- nativeStyleMapping?: T extends false
- ? NativeStyleMapping>
- : NativeStyleMapping<
- ResolveDotPath>,
- ComponentProps
- >;
+ nativeStyleMapping?:
+ | (T extends false
+ ? NativeStyleMapping>
+ : NativeStyleMapping<
+ ResolveDotPath>,
+ ComponentProps
+ >)
+ | undefined;
/** @deprecated Please use nativeStyleMapping */
nativeStyleToProp?: StyledConfigurationObject["nativeStyleMapping"];
}
type NativeStyleMapping = T extends object
? {
- [K in keyof T as K extends string ? K : never]: true | DotNotation;
+ [K in keyof T as K extends string ? K : never]:
+ | true
+ | DotNotation
+ | undefined;
} & {
- fill?: true | DotNotation;
- stroke?: true | DotNotation;
+ fill?: true | DotNotation | undefined;
+ stroke?: true | DotNotation | undefined;
}
- : Record>;
+ : Record | undefined>;
export interface StyledOptions {
- passThrough?: boolean;
+ passThrough?: boolean | undefined;
}
/*************************** React Helpers ***************************/
diff --git a/types.d.ts b/types.d.ts
index 924b9a7d..9811ec12 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -10,44 +10,44 @@ import type {
declare module "@react-native/virtualized-lists" {
export interface VirtualizedListWithoutRenderItemProps
extends ScrollViewProps {
- ListFooterComponentClassName?: string;
- ListHeaderComponentClassName?: string;
+ ListFooterComponentClassName?: string | undefined;
+ ListHeaderComponentClassName?: string | undefined;
}
}
declare module "react-native" {
interface ButtonProps {
- className?: string;
+ className?: string | undefined;
}
interface ScrollViewProps
extends ViewProps,
ScrollViewPropsIOS,
ScrollViewPropsAndroid,
Touchable {
- contentContainerClassName?: string;
+ contentContainerClassName?: string | undefined;
}
interface FlatListProps extends VirtualizedListProps {
- columnWrapperClassName?: string;
+ columnWrapperClassName?: string | undefined;
}
interface ImageBackgroundProps extends ImagePropsBase {
- imageClassName?: string;
+ imageClassName?: string | undefined;
}
interface ImagePropsBase {
- className?: string;
+ className?: string | undefined;
}
interface ViewProps {
- className?: string;
+ className?: string | undefined;
}
interface TextProps {
- className?: string;
+ className?: string | undefined;
}
interface SwitchProps {
- className?: string;
+ className?: string | undefined;
}
interface TouchableWithoutFeedbackProps {
- className?: string;
+ className?: string | undefined;
}
interface KeyboardAvoidingViewProps extends ViewProps {
- contentContainerClassName?: string;
+ contentContainerClassName?: string | undefined;
}
}