Bug: React - Cannot update a component (`HotReload`) while rendering a different component (`TriggerWrapper`)

Open
#495 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Domain
frontend

Research direction

Reproduce the warning in a Next.js environment using trigger 2.2.5, antd 5.22.2, Next.js 15.03, and React 18.3.1. Start with the stack trace at TriggerWrapper.js:19 and the referenced hot-reloader-client.js and use-error-handler.js entries; done means the warning is reproduced, its cause is identified, and a regression test confirms it no longer occurs.

Written by the indexing model from the issue text.

Description

It seems that upgrading to the latest react verion and nextjs version following bug occurs:

intercept-console-error.js:56 Cannot update a component (`HotReload`) while rendering a different component (`TriggerWrapper`). To locate the bad setState() call inside `TriggerWrapper`, follow the stack trace as described in https://react.dev/link/setstate-in-render

This is the stack trace:


error	@	intercept-console-error.js:56
scheduleUpdateOnFiber	@	react-dom-client.development.js:14254
dispatchReducerAction	@	react-dom-client.development.js:7112
eval	@	hot-reloader-client.js:432
handleClientError	@	use-error-handler.js:50
error	@	intercept-console-error.js:53
elementRefGetterWithDeprecationWarning	@	react.development.js:446
TriggerWrapper	@	TriggerWrapper.js:19
react-stack-bottom-frame	@	react-dom-client.development.js:22339
renderWithHooks	@	react-dom-client.development.js:5731
updateForwardRef	@	react-dom-client.development.js:7736
beginWork	@	react-dom-client.development.js:9988
runWithFiberInDEV	@	react-dom-client.development.js:544
performUnitOfWork	@	react-dom-client.development.js:14986
workLoopSync	@	react-dom-client.development.js:14816
renderRootSync	@	react-dom-client.development.js:14794
performWorkOnRoot	@	react-dom-client.development.js:14288
performWorkOnRootViaSchedulerTask	@	react-dom-client.development.js:15843
performWorkUntilDeadline	@	scheduler.development.js:44

Note that this happens in a nextjs environment (in combo with ant design)

trigger version: 2.2.5
antd: 5.22.2
nextjs: 15.03
react: 18.3.1

Dominant language
TypeScript
Stars
391
Forks
245
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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 react-component/trigger

All issues in react-component/trigger

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.