From 701d856d45d03c29ebba62cf52503cceb859e7a9 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:05:19 -0700 Subject: [PATCH] Allow all parts of state to be undefined This prevents type errors when calling setState. --- src/components/tree/tree.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/tree/tree.tsx b/src/components/tree/tree.tsx index 622d1bd96..8e220da32 100644 --- a/src/components/tree/tree.tsx +++ b/src/components/tree/tree.tsx @@ -93,9 +93,9 @@ export interface TreeComponentPropsFromState { } export interface TreeComponentState { - hoveredNode: ReactTreeNode | null - tree: PhyloTree | null - treeToo: PhyloTree | null + hoveredNode?: ReactTreeNode + tree?: PhyloTree + treeToo?: PhyloTree geneSortFn?: any selectedNode?: Record // I think this is ReactTreeNode but only set to empty. } @@ -116,11 +116,7 @@ export class TreeComponent extends React.Component