Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Nov 10, 2022
1 parent 713adf8 commit 2d19b1e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const RootContext = React.createContext<{
// We cache the expanded state of tree items so we can preserve the state
// across remounts. This is necessary because we unmount tree items
// when their parent is collapsed.
expandedStateCache: React.RefObject<Map<string, boolean>>
expandedStateCache: React.RefObject<Map<string, boolean> | null>
}>({
announceUpdate: () => {},
expandedStateCache: {current: new Map()}
Expand Down Expand Up @@ -261,13 +261,13 @@ const Root: React.FC<TreeViewProps> = ({'aria-label': ariaLabel, 'aria-labelledb
}
}
})
const expandedStateCache = React.useRef(null)

const expandedStateCache = React.useRef<Map<string, boolean> | null>(null)

if (expandedStateCache.current === null) {
expandedStateCache.current = new Map();
expandedStateCache.current = new Map()
}

return (
<RootContext.Provider
value={{
Expand Down

0 comments on commit 2d19b1e

Please sign in to comment.