Skip to content

Commit

Permalink
fix customProps types
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-levy committed Jul 4, 2023
1 parent 52d4bb9 commit ae803ff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import { ComponentProps, createElement } from 'react';
import { allowedProps } from './allowedProps';
import { StyleProp, Text, View } from 'react-native';

type Prettify<T> = {
[k in keyof T]: T[k] extends string | number | boolean | undefined | null
? T[k]
: T[k] extends object
? Prettify<T[k]>
: never;
};

type Options<T extends React.ComponentType<any>> = {
aliases?: Record<string, keyof StyleObject<T>>;
defaultStyles?: StyleObject<T>;
customProps?: Record<string, StyleObject<T>>;
customProps?: Prettify<Record<string, StyleObject<T>>>;
};

type AliasedStyles<
Expand Down

0 comments on commit ae803ff

Please sign in to comment.