From 07e5d7faf7f7c3138195e39f90ce37378d45edfc Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 19 Feb 2020 22:15:25 -0800 Subject: [PATCH] Don't subscribe to entire store. Don't cause rerender on every store change Reviewed By: passy Differential Revision: D19968715 fbshipit-source-id: 74e5ca9d2f68c6fa4e04771e7ad7ba1fecb207f3 --- src/reducers/pluginStates.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/pluginStates.tsx b/src/reducers/pluginStates.tsx index 6c390f3d9..2cbf15216 100644 --- a/src/reducers/pluginStates.tsx +++ b/src/reducers/pluginStates.tsx @@ -39,7 +39,7 @@ export default function reducer( ): State { if (action.type === 'SET_PLUGIN_STATE') { const newPluginState = action.payload.state; - if (newPluginState && newPluginState !== state) { + if (newPluginState && newPluginState !== state[action.payload.pluginKey]) { return { ...state, [action.payload.pluginKey]: {