From 4a8a4aabb68b214fd238979ed755ccb98ed36c5f Mon Sep 17 00:00:00 2001 From: John Knox Date: Mon, 14 Oct 2019 07:48:18 -0700 Subject: [PATCH] Purify Glyph component Summary: A significant proportion of CPU time when doing a target selection in the layout plugin, was spent rendering Glyphs. They shouldn't really be doing anything expensive in render, but since they already are, this will make sure they don't re-render unnecessarily. Reviewed By: passy Differential Revision: D17906723 fbshipit-source-id: ece143f65fd46d8582e21455732049368f301186 --- src/ui/components/Glyph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/components/Glyph.tsx b/src/ui/components/Glyph.tsx index 4ddc31d6e..89dd60def 100644 --- a/src/ui/components/Glyph.tsx +++ b/src/ui/components/Glyph.tsx @@ -81,7 +81,7 @@ ColoredIcon.contextTypes = { glyphColor: PropTypes.string, }; -export default class Glyph extends React.Component<{ +export default class Glyph extends React.PureComponent<{ name: string; size?: IconSize; variant?: 'filled' | 'outline';