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
This commit is contained in:
John Knox
2019-10-14 07:48:18 -07:00
committed by Facebook Github Bot
parent 874e590b96
commit 4a8a4aabb6

View File

@@ -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';