Skip to content

[pull] main from react:main - #671

Merged
pull[bot] merged 2 commits into
code:mainfrom
react:main
Sep 15, 2026
Merged

pull[bot] merged 2 commits into
code:mainfrom
react:main

Conversation

@pull

@pull pull Bot commented Sep 15, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

scttcper and others added 2 commits September 15, 2026 12:10
Backports oxc-project/oxc#26451 to the Rust
React Compiler.

Check component parameters before scanning for hooks or JSX, so
functions with invalid component signatures skip the traversal.
Component classification stays the same.

Co-authored-by: Codex <noreply@openai.com>
…37576)

## Summary

`react-hooks/purity` already reports `Date.now()` during render, but not
`new Date()` / `new Date().getTime()` / `new Date().getFullYear()`.
Those also read the current clock. React's purity docs list `new Date()`
next to `Date.now()`.

Zero-argument `new Date()` is now treated as an impure call (same
diagnostic as `Date.now()`). Constructing from an explicit timestamp
stays allowed: `new Date(timestamp)`.

Fixes #37553

## How did you test this change?

- `yarn snap --pattern "**/*new-date*"` (4 fixtures passed)
- `yarn workspace eslint-plugin-react-compiler test --
ImpureFunctionCallsRule` (4 tests passed)


Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Pieter De Baets <pieter.debaets@gmail.com>
@pull pull Bot locked and limited conversation to collaborators Sep 15, 2026
@pull pull Bot added the ⤵️ pull label Sep 15, 2026
@pull
pull Bot merged commit ff8f88f into code:main Sep 15, 2026

This branch was successfully deployed

1 active deployment
npm ff8f88fc Deployed Sep 15, 2026 by pull[bot] via Publish release #80
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants