diff --git a/App.tsx b/App.tsx index 889c03b..dade68d 100644 --- a/App.tsx +++ b/App.tsx @@ -88,6 +88,15 @@ const App = () => { [settings, setSettings], ) + const action = useMemo( + () => ({ + label: 'Close', + onPress: () => setSnackbar(''), + color: theme.colors.primary, + }), + [theme.colors.primary], + ) + return ( { duration={3000} onDismiss={() => setSnackbar('')} visible={!!snackbar} - action={{ - label: 'Close', - onPress: () => setSnackbar(''), - color: theme.colors.primary, - }}> + action={action}> {snackbar}