Skip to content

Commit ee75a80

Browse files
committed
fix: remove useMemo
1 parent 80c0e74 commit ee75a80

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

example/src/components/ToolbarColorButton.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMemo, type FC } from 'react';
1+
import { type FC } from 'react';
22
import { Pressable, StyleSheet, Text } from 'react-native';
33

44
interface ColorButtonProps {
@@ -18,16 +18,14 @@ export const ToolbarColorButton: FC<ColorButtonProps> = ({
1818
onPress(color);
1919
};
2020

21-
const containerStyle = useMemo(
22-
() => [
23-
styles.container,
24-
{ backgroundColor: isActive ? color : 'rgba(0, 26, 114, 0.8)' },
25-
],
26-
[isActive, color]
27-
);
28-
2921
return (
30-
<Pressable style={containerStyle} onPress={handlePress}>
22+
<Pressable
23+
style={[
24+
styles.container,
25+
{ backgroundColor: isActive ? color : 'rgba(0, 26, 114, 0.8)' },
26+
]}
27+
onPress={handlePress}
28+
>
3129
<Text style={[styles.text, !isActive && { color }]}>{text}</Text>
3230
</Pressable>
3331
);

0 commit comments

Comments
 (0)