reactjs / reactjs/react.dev

The double rendering of lifecycle methods in Strict Mode needs to be presented more loudly

Open
#4,765 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

I have just lost a day's work wondering why my GSAP animations weren't working only to realize the double call in strict mode. While I understand the reasons for strict mode, I still think having a Caveats section or something to warn developers would be highly beneficial.

I did stumble on this GSAP thread and it seems like both sides are just saying "It's not really my problem" while we the developers kind of suffer.

Now, I do know of the existence of the changelog but new developers wouldn't be aware of this issue right away and I just want to save their time. So, maybe having a Gotchas section where you can just write some notes regarding how strict mode calling twice may affects 3rd party libraries like GSAP's from() tweens could help developers tackle this issue early? Just my two cents.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the existing Strict Mode documentation and reviewing how its caveats and changelog are presented. Add a prominent warning about lifecycle methods rendering twice and the impact on third-party libraries such as GSAP; done when new developers can find this guidance without searching the changelog.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.