Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bad set state in WorkflowStatus component

Open
#85 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start at frontend/src/components/workflows/WorkflowStatus.tsx lines 226-234 and compare the behavior with and without useEffect. Read the linked React setState-in-render guidance and document why the warning occurs, what the existing fix changes, and how to verify the warning no longer appears.

Written by the indexing model from the issue text.

Description

Mentioned in the documentation
SOLVED: call useEffect to set state so it is changed after render

https://github.com/DiamondLightSource/TomoHub/blob/e8095d9d6aec18d6258a32a3d7205ee438b38066/frontend/src/components/workflows/WorkflowStatus.tsx#L226-L234

If the useEffect is removed the following error occurs:
Warning: Cannot update a component (CropProvider) while rendering a different component (WorkflowStatus). To locate the bad setState() call inside WorkflowStatus, follow the stack trace as described in https://reactjs.org/link/setstate-in-render WorkflowStatus@http://localhost:5173/src/components/workflows/WorkflowStatus.tsx?t=1764062699314:83:24 div div...

Although this is no longer an issue the fix and the core problem are not fully understood.

Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
15h 17m
Merged PRs (30d)
50

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/ImagingHub

All issues in DiamondLightSource/ImagingHub

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.