Skip to content

Commit

Permalink
fix: add useMemo to memorise current step
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorien Grönwald committed Jun 18, 2024
1 parent 680bff1 commit 4bf85c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tsx/components/hero/ProjectHeroContent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from 'react';
import { useState, useMemo } from 'react';
import ProcessCard from './../cards/ProcessCard';
import { steps } from '../../../data/processSteps';
import StepCircle from './../process/StepCircle';

function ProjectHeroContent() {
const activeStep = steps.findIndex(step => step.isCurrent);
const activeStep = useMemo(() => steps.findIndex(step => step.isCurrent), []);

const [visibleStep, setVisibleStep] = useState(activeStep);

Expand Down

0 comments on commit 4bf85c3

Please sign in to comment.