Skip to content

Instantly share code, notes, and snippets.

@sakymar
Created September 16, 2022 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakymar/11f600065689829e8596055a10de285d to your computer and use it in GitHub Desktop.
Save sakymar/11f600065689829e8596055a10de285d to your computer and use it in GitHub Desktop.
import 'react-native'
declare module 'react-native' {
namespace StyleSheet {
type Style = ViewStyle | TextStyle | ImageStyle
type NamedStyles<T> = { [P in keyof T]: Style }
/**
* Creates a StyleSheet style reference from the given object.
*/
export function create<T, S extends NamedStyles<S> | NamedStyles<any>>(
styles: T | NamedStyles<S>,
): T & S
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment