diff --git a/example/src/App.tsx b/example/src/App.tsx index e0f56d14..a763aee4 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -16,12 +16,7 @@ export const App: React.FunctionComponent = () => { return ( - setTheme(prevState => prevState === Theme.Light - ? Theme.Dark - : Theme.Light - )} - /> + ) } diff --git a/example/src/examples/Memoization.tsx b/example/src/examples/Memoization.tsx new file mode 100644 index 00000000..5778da33 --- /dev/null +++ b/example/src/examples/Memoization.tsx @@ -0,0 +1,54 @@ +import React from 'react' +import { Text, View, type StyleProp, type TextStyle, Button } from 'react-native' +import { createStyleSheet, useStyles } from '../styles' + +export const Memoization: React.FunctionComponent = () => { + const { styles } = useStyles(stylesheet) + const [ count, setCount ] = React.useState(0) + + return ( + + + + +