Skip to content

Commit

Permalink
Improve using memo for loading dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
claushellsing committed Sep 3, 2024
1 parent 1814d21 commit a189952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useState, useMemo } from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';
Expand Down Expand Up @@ -143,7 +143,7 @@ export const Tab: React.FC = () => {
const [dependants, setDependants] = useState<TreeViewBaseItem[]>([]);
const [expandedIds, setExpandedIds] = useState<string[]>([]);

useEffect(() => {
useMemo(() => {
const globalDependencyMap = globals['storybook_dependency_map'];
const storiesList = globals['stories_list'];
const currentDependencyMap = globalDependencyMap[currentStoryPath];
Expand Down

0 comments on commit a189952

Please sign in to comment.