From 2dd580f24a5b82935cf58292ff464a461d2eb714 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 29 Jul 2019 06:04:16 -0700 Subject: [PATCH] Fix flow errors (#502) Summary: We had a brief moment without Flow coverage, where this must have snuck in. Not sure if there's a better type for `node` given the current structure, but the rest should be obvious. Pull Request resolved: https://github.com/facebook/flipper/pull/502 Test Plan: flow Reviewed By: jknoxville Differential Revision: D16533248 Pulled By: passy fbshipit-source-id: 51e493208050e4af531e161fb49eda77fdf2494e --- src/plugins/sections/Tree.js | 4 +++- src/plugins/sections/index.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/sections/Tree.js b/src/plugins/sections/Tree.js index 4a6a06976..45576b68c 100644 --- a/src/plugins/sections/Tree.js +++ b/src/plugins/sections/Tree.js @@ -62,11 +62,13 @@ type TreeData = Array<{ removed?: boolean, updated?: boolean, unchanged?: boolean, + isSection?: boolean, + isDataModel?: boolean, }>; type Props = { data: TreeData | SectionComponentHierarchy, - nodeClickHandler?: (node, evt) => void, + nodeClickHandler?: (node: any, evt: InputEvent) => void, }; type State = { diff --git a/src/plugins/sections/index.js b/src/plugins/sections/index.js index 67cee8754..97bb78c4d 100644 --- a/src/plugins/sections/index.js +++ b/src/plugins/sections/index.js @@ -170,7 +170,7 @@ export default class extends FlipperPlugin { }); }; - onNodeClicked = (targetNode, evt) => { + onNodeClicked = (targetNode: any, evt: InputEvent) => { if (targetNode.attributes.isSection) { this.setState({ selectedTreeNode: null, @@ -179,7 +179,6 @@ export default class extends FlipperPlugin { } let dataModel; - const selectedTreeNode = {}; // Not all models can be parsed. if (targetNode.attributes.isDataModel) { try {