You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
385 B
11 lines
385 B
import { useMemo } from 'react';
|
|
import { StyleSheet } from 'react-native';
|
|
import { useTheme } from './ThemeProvider';
|
|
export const makeStyles = (styles) => (props = {}) => {
|
|
const { theme } = useTheme();
|
|
return useMemo(() => {
|
|
const css = typeof styles === 'function' ? styles(theme, props) : styles;
|
|
return StyleSheet.create(css);
|
|
}, [props, theme]);
|
|
};
|