Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3388945
D9071.id30814.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
831 B
Referenced Files
None
Subscribers
None
D9071.id30814.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 4:46 PM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2601364
Default Alt Text
D9071.id30814.diff (831 B)
Attached To
Mode
D9071: [native] Add some memoization to `ColorSplotch`
Attached
Detach File
Event Timeline
Log In to Comment