Page MenuHomePhabricator

D9071.diff
No OneTemporary

D9071.diff

diff --git a/native/components/color-splotch.react.js b/native/components/color-splotch.react.js
--- a/native/components/color-splotch.react.js
+++ b/native/components/color-splotch.react.js
@@ -20,16 +20,21 @@
return styles.large;
}, [size]);
- return (
- <SquircleView
- style={style}
- squircleParams={{
- cornerSmoothing: 0.95,
- cornerRadius: 10,
- fillColor: `#${color}`,
- }}
- />
+ const squircleParams = React.useMemo(
+ () => ({
+ cornerSmoothing: 0.95,
+ cornerRadius: 10,
+ fillColor: `#${color}`,
+ }),
+ [color],
);
+
+ const colorSplotch = React.useMemo(
+ () => <SquircleView style={style} squircleParams={squircleParams} />,
+ [squircleParams, style],
+ );
+
+ return colorSplotch;
}
const styles = StyleSheet.create({

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 2:55 PM (19 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2601364
Default Alt Text
D9071.diff (831 B)

Event Timeline