Skip to content

fix: use module-level NOW_MS constant instead of Date.now() in render - #1950

Merged
Flotapponnier merged 11 commits into
mainfrom
ship/dev-to-main-aug13
Aug 13, 2026
Merged

fix: use module-level NOW_MS constant instead of Date.now() in render#1950
Flotapponnier merged 11 commits into
mainfrom
ship/dev-to-main-aug13

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

React compiler flags Date.now() as an impure function call during render. Moving it to module scope (captured once at load time) satisfies the compiler while keeping the stale-data check functional.

@Flotapponnier
Flotapponnier merged commit 3845ec0 into main Aug 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant