owner
stringclasses
4 values
repo
stringclasses
4 values
number
int32
1
147k
node_id
stringlengths
18
32
is_pull_request
bool
2 classes
title
stringlengths
1
630
body
stringlengths
0
248k
state
stringclasses
5 values
state_reason
stringclasses
7 values
author
stringlengths
0
39
created_at
timestamp[us]date
2000-06-06 02:40:44
2026-03-29 15:50:21
updated_at
timestamp[us]date
2013-05-29 20:56:09
2026-03-29 16:29:24
closed_at
timestamp[us]date
2000-06-07 02:36:03
2026-03-29 16:17:08
labels
unknown
assignees
unknown
milestone_title
stringclasses
452 values
milestone_number
int32
0
432
reactions
unknown
comment_count
int32
0
2.47k
locked
bool
2 classes
lock_reason
stringclasses
5 values
detail_fetched_at
timestamp[us]date
2026-03-29 04:12:38
2026-03-30 02:27:59
facebook
react
36,045
I_kwDOAJy2Ks7y8wdF
false
🧪 <AutoGrader> Infinite Loop on "Divide by Zero" Submission ♾️
### Description The `<AutoGrader />` component enters an unrecoverable infinite loop when a student submits a Python script containing a naked `x / 0` operation. Instead of returning a `RuntimeError`, the grading engine attempts to "calculate the void," resulting in 100% CPU usage on the evaluation node. ### 🔍 Observed Issue * **The Loop:** The progress spinner spins so fast it creates a visual "strobe" effect before the browser tab freezes. 😵‍ * **Resource Leak:** Memory consumption climbs steadily until the OS terminates the process. 📈 * **Feedback:** The "Hints" panel suggests the student "Wait for the heat death of the universe" to see their results. 🌌 --- ### ✨ Expected Behavior * **Validation:** The static analyzer should catch division by zero before execution. * **Timeout:** The sandbox should terminate any process exceeding 500ms. ⏱️ * **Graceful Failure:** Display a "Division by zero is a crime against math" error message. 👮 --- ### 🛠️ Reproduction Steps 1. Navigate to the **Grade 12 Physics** portal. 2. Upload `gravity_calc.py` with `g = 9.8 / (1 - 1)`. 3. Click "Submit" and listen to your laptop fans reach terminal velocity. 🚁 --- ## Subject: 🏹 <QuestLog> NPC "Quest-Giver" Identity Crisis 🎭 --- ### Description In the current build of the **Medieval RPG Engine**, NPCs (Non-Player Characters) are experiencing a data-sync issue where they swap dialogue trees mid-conversation. This leads to immersion-breaking scenarios where a "Village Elder" starts speaking like a "Level 50 Dragon." ### 🔍 Observed Issue * **Dialogue Swap:** The blacksmith is currently offering to "Devour your soul and burn the kingdom" instead of fixing a bronze sword. 🐉 * **Trade Logic:** The "Shopkeeper" accepts 500 gold in exchange for "The secret of fire," but actually just gives the player a stale loaf of bread. 🍞 * **Animation Glitch:** High-level bosses are performing the "Farmer's Hoeing" animation during combat sequences. 🧑‍🌾 --- ### ✨ Expected Behavior * **State Locking:** NPC dialogue state must be locked to their `entity_id` upon interaction. * **Asset Mapping:** Ensure the `Combat_Idle` animation is not indexed next to `Harvest_Wheat`. 🌾 --- ### 🛠️ Reproduction Steps 1. Travel to the **Shadow Realm** waypoint. 2. Talk to the **Undead King**. 3. Observe as he asks you if you've "found his lost sheep" in a high-pitched voice. 🐑 --- ## Subject: ☕ <SmartMug> Firmware: Coffee Temperature "Overflow" ♨️ --- ### Description The `<SmartMug />` IoT integration is reporting temperatures in **Kelvin** but treating the integers as **Celsius**. This causes the mobile app to believe the coffee is currently the surface temperature of the Sun. ### 🔍 Observed Issue * **UI Alert:** The app sends a push notification: "Warning: Coffee has reached Fusion Temperature. Please evacuate the kitchen." ☢️ * **Hardware Lock:** The mug’s safety lid locks permanently to prevent "Plasma Leakage." 🔒 * **Graphing:** The temperature chart has exited the top of the screen and is currently overlapping with the "Battery Level" icon. --- ### ✨ Expected Behavior * **Unit Conversion:** Check the `Math.round()` logic in the `TempParser.swift` file. 📐 * **Safety Clamp:** Hard-cap the reported temperature at **100°C** (unless the user is brewing in a vacuum). ☕ --- ### 🛠️ Reproduction Steps 1. Pour a standard cup of black coffee into the SmartMug. 2. Open the **MugControl** app. 3. Observe the "Current Temp" reading: `5,778 K`. ☀️ --- > **Note:** The "Quest-Giver" bug is funny, but the "SmartMug" issue is a genuine fire hazard. Would you like me to draft a **GitHub Issue** for the `AutoGrader` loop or a **Firmware Patch** for the `SmartMug`?```
closed
not_planned
e6
2026-03-14T15:18:22
2026-03-24T20:27:18
2026-03-17T10:14:30
[ "Status: Unconfirmed" ]
null
0
{}
2
false
2026-03-29T04:53:23.441852
facebook
react
36,040
I_kwDOAJy2Ks7y43zQ
false
Bug: Server functions work on event handler props in Server Components; is this intended?
# Server functions work on event handler props in Server Components — is this intended? **This isn't a bug report** - the behaviour described below works correctly. I'm raising this to ask whether it's intended/stable behaviour and whether it should be documented. React version: 19 ## Steps To Reproduce 1. Create a Server Component (no `"use client"` directive) 2. Define a server function (`"use server"`) inside it 3. Pass the server function directly to an event handler prop on a native element (e.g., `onClick`, `onMouseEnter`) 4. Trigger the event — it sends a POST request to the server and executes the function Link to code example: ```tsx // This is a Server Component (no "use client" directive) export default function Page() { async function handleClick() { "use server"; console.log("click"); } async function handleHover() { "use server"; console.log("hovering..."); } return ( <div> <button onClick={handleClick}>Click me</button> <h2 onMouseEnter={handleHover}>Hover me</h2> </div> ); } ``` **Note:** Passing the event object to the server function (e.g., `onClick={(e) => handleClick(e)}`) errors out, presumably because the event cannot be serialized. The bare function reference works fine. ### Tested across | Framework | React | Result | | ---------------- | ----- | ------------------------------------------------------------------- | | Next.js 16 | 19 | ✅ Works | | Next.js 15.5.9 | 19 | ✅ Works | | Next.js 14.2.35 | 18 | ❌ Crashes: "Only plain objects, and a few built-ins, can be passed to Server Actions" | | Waku | 19 | ✅ Works (independently confirmed) | The fact that this works on both Next.js and Waku suggests it's a React-level behaviour, not framework-specific. ## The current behaviour Server functions can be passed directly to any event handler prop on native elements inside Server Components. Both handlers fire POST requests to the server. This works on React 19 but crashes on React 18. ## The expected behaviour Based on the current documentation, I would expect this to require a Client Component wrapper. The documented patterns for server functions on native elements are: - As a form `action` prop - Passed as a prop to a Client Component, which then attaches it to an event handler The [Server Functions reference](https://react.dev/reference/rsc/server-functions) shows server functions used with `onClick`, but always through a Client Component wrapper that calls `() => onClick()`. The [Server Components docs](https://react.dev/reference/rsc/server-components) still state: "To add interactivity, compose them with Client Components." ## What I think is happening The React 19 serializer handles server function references on any event handler prop via `isServerReference`. In React 18, the serializer attempted to serialize the event object and failed. In React 19, the event appears to be discarded and the server function is invoked directly. This seems like an emergent byproduct of the serializer doing its job rather than a deliberate feature - but it's a useful pattern and it would be helpful to know: 1. Is this intended and stable behavior? 2. If so, should the docs be updated to reflect it? 3. If not, is it likely to change in future versions?
open
slouloudis
2026-03-14T07:26:57
2026-03-24T20:31:33
null
[ "Status: Unconfirmed" ]
null
0
{}
2
false
2026-03-29T04:53:23.512956
facebook
react
35,854
I_kwDOAJy2Ks7sv7Pw
false
[Compiler Bug]: NaN in dependency list of useMemo always causes re-evaluation
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEASggIZx4A0BwBUYCJAZtfQgMp6l4IEC+BJjAgYCAchhkKYgDoA7eUyhyKaCHIIZSAawQB9GKTkATEQAoAlDXkFbBSXlgaAstwAWAOkMnzF+X3l5BAAPHHwCYwQmUigAG0IlFTw1FwBPAEEsLEtrDTsAenyCMEwsWN4wLh4CPAgCOBiGewQAWkkTBBgbOzh1SoIAbUruBGoGPE4RgF0CAF5iKTwPNkmeMwAGPwU820KagjQwAlJYgHdSVKOAOVIr4rQVCqreE-PLggA+efXu2165fqEebDapfAjrAgAfgINzuyHBgR2BD26liqUEaEkR3UiAIpzQeDc0EIvWwaHKXSR-36ADc5gtyEs2M4EBgIGYcrMPrk7LzkUVXhcjgBzBByTojI7i072IymURyKAYABGnQIvz5DicBzAsLMeCs0K0ugMct8BHhPyRfGoAzwUy2iN5e3xhPqIiw5LVYtIyvKxmodMOdCwxhGxgI6gIUjc9ViaDg2g1WpgGgAPMY0HT1ABheOJ2bATnc8arBBmOBzblwADUAEYLHwPgAJBCxWJ1ADquFixnhwBpAiKwBBCD4afymZpHwA3P55CBKCB-kw0MKUOhsLhCHhUlheLQAAqxKDCh4AeSwyT6-EEwlEYmVvrbLTKp4ebUWLVJnopk8OeBiHO2xmMA3SFD+5LcCkzgQJE8IyCAJyxIh-jFNBYCrggRzHu+ciXteAIWDOi7gESpwAJJyDwqYnGAKDRLEDB8EAA ### Repro steps See playground link. Click on the div to increment the counter and see that the memoised value changes even though the single dependency is always `NaN`. The example is obviously contrived and perhaps you consider having NaN in a dependency list not valid/supported. However useMemo without the compiler handles this case and does not re-evaluate. This caused a subtle bug in my app when enabling the compiler. Apologies if this is a duplicate, I looked but could not find similar. ### How often does this bug happen? Every time ### What version of React are you using? 19.2.4 ### What version of React Compiler are you using? 1.0.0
open
jugglingcats
2026-02-21T12:59:05
2026-03-24T20:31:37
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{}
3
false
2026-03-29T04:53:23.734577
facebook
react
36,137
I_kwDOAJy2Ks72Rzh5
false
[Compiler Bug]: incorrectly handles `use` hook when called on a non-`React` object
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEASggIZyEBmMEGBA5DGRfQDoB2HlU7FaE7AgEEsWABQBKAsA4ECcAWEIA3AgF5izPADooYBJIDcBAPQmCgUHICAd1wBrMLIJM8sQQB4AJmmUA+YMoAvu4m3n4cgRxcPHwCwqIATJLSTgrsSgQA2soAuuqa5Dp6CADKeKR4BhLGZpY29o6CzgiuMB5h-kEhHRFR7LUAtEPDI6NjfZg4+AUUQgA2aKRgBNS0DEyFbJz95oAy5NG8ePyCIlgAzMkyTWkZqhokhfOLYLr6RqZ7K6Roc41ytTcVPlIBgEAB5ABGACtXlUap9SL8IF8fo0nC43AQvD5OsFQjjettuIdjvEsAAWS6pRSEbJ5e5aJ5LWFlCpwj51WwwBxOAE0gh3Agg8HQlnlSrvWpWRGQercv7NVrtHEBPE9diRdggAA0IDSlDQAHMUOhsLhCHgAJ5YBDSAgABTmUENaHYYKwR0UBECKxodHoENIEIQcwGWCdLvYAw2FAGCmwPwQMHxSnohj6Yiu-xM8awPwqxwAshBPAhkARWCBEXNKxEhQWwAaEMtHc7Xe7PelqjrwAALCDWACS7EqbRlKEoMoQgSAA ### Repro steps When the `use` hook is called on an object that is not exactly the identifier `React` (e.g., an aliased import or any other object), the React Compiler produces incorrect output. The compiled code moves the hook call inside a conditional cache block, violating the Rules of Hooks. In contrast, other hooks like `useState` are compiled correctly regardless of the object name. **Steps to Reproduce** Input code: ```jsx import React from 'react' function App() { const v = React.use(); // ✅ works return <div>{v}</div> } function App2() { const [v] = React.useState(); // ✅ works return <div>{v}</div> } // --------------------- import ReactAlias from 'react' // ❌ function App3() { const v = ReactAlias.use(); // ❌ fails // const v = someObj.use(); // ❌ also fails return <div>{v}</div> } function App4() { const [v] = ReactAlias.useState(); // ✅ works // const v = someObj.useState(); // ✅ also works return <div>{v}</div> } ``` **Actual Output (compiled with React Compiler)** ```jsx import { c as _c } from "react/compiler-runtime"; import React from "react"; function App() { const $ = _c(2); const v = React.use(); let t0; if ($[0] !== v) { t0 = <div>{v}</div>; $[0] = v; $[1] = t0; } else { t0 = $[1]; } return t0; } function App2() { const $ = _c(2); const [v] = React.useState(); let t0; if ($[0] !== v) { t0 = <div>{v}</div>; $[0] = v; $[1] = t0; } else { t0 = $[1]; } return t0; } // --------------------- import ReactAlias from "react"; // ❌ function App3() { const $ = _c(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { const v = ReactAlias.use(); t0 = <div>{v}</div>; $[0] = t0; } else { t0 = $[0]; } return t0; } function App4() { const $ = _c(2); const [v] = ReactAlias.useState(); let t0; if ($[0] !== v) { t0 = <div>{v}</div>; $[0] = v; $[1] = t0; } else { t0 = $[1]; } return t0; } ``` **Expected Output** For `App3`, the compiler should produce output similar to `App`, where the hook’s return value (`v`) is tracked as a dependency rather than the whole JSX element being cached unconditionally. The hook call should remain outside any conditional block to maintain the Rules of Hooks. **Additional Observations** - The issue occurs when `use` is called on any object whose name is not exactly `React`. - Other hooks (e.g., `useState`, `useEffect`) are compiled correctly even when called on aliased imports. - The problem is specific to the `use` hook; it appears that the compiler’s optimization for `use` depends on the object being named `React`. ### How often does this bug happen? Every time ### What version of React are you using? 19.2.0 ### What version of React Compiler are you using? 1.0.0
open
shixianqin
2026-03-25T02:07:07
2026-03-25T02:07:07
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:23.770233
facebook
react
26,886
I_kwDOAJy2Ks5ngeW-
false
Bug: Inconsistent behavior with Promises near the root
Just jotting down some cases I found confusing. Ideally for each case, it should either work, or should fail in some obvious way. ## Working: startTransition + 1000ms Promise root ```js import { startTransition } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); let promise = new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }); startTransition(() => { root.render(promise); }); ``` https://codesandbox.io/s/goofy-rui-8g6sxh?file=/src/index.js ## Working: startTransition + root component + 5000ms Promise child ```js import { startTransition } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); let promise = new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 5000); }); function Foo() { return promise; } startTransition(() => { root.render(<Foo />); }); ``` https://codesandbox.io/s/epic-cookies-v94rk2?file=/src/index.js ## Working: No startTransition + root component + 5000ms Promise child ```js import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); let promise = new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 5000); }); function Foo() { return promise; } root.render(<Foo />); ``` https://codesandbox.io/s/zen-allen-2u1nr7?file=/src/index.js ## Working: startTransition + root component + 1000ms Promise in state ```js import { useState, startTransition } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); function Foo() { const [promise, setPromise] = useState( new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }) ); return promise; } startTransition(() => { root.render(<Foo />); }); ``` https://codesandbox.io/s/immutable-moon-2h3dqz?file=/src/index.js ## Working: startTransition + root component + 1000ms Promise in state + use ```js import { use, useState, startTransition } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); function Foo() { const [promise, setPromise] = useState( new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }) ); return use(promise); } startTransition(() => { root.render(<Foo />); }); ``` https://codesandbox.io/s/hungry-carlos-1n8hqu?file=/src/index.js ## Crashes: startTransition + 5000ms Promise root This doesn't work (with a confusing crash): ```js import { startTransition } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); let promise = new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 5000); // <--- I increased the delay }); startTransition(() => { root.render(promise); }); ``` https://codesandbox.io/s/busy-torvalds-xgbcgh?file=/src/index.js ## Crashes: No startTransition + 1000ms Promise root This doesn't work (with a confusing crash): ```js import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); let promise = new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }); root.render(promise); // No startTransition ``` https://codesandbox.io/s/serene-payne-677ghp?file=/src/index.js ## Never resolves: No startTransition + root component + 1000ms Promise in state ```js import { useState } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); function Foo() { const [promise, setPromise] = useState( new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }) ); return promise; } root.render(<Foo />); ``` https://codesandbox.io/s/musing-chaplygin-2udvbx?file=/src/index.js ## Never resolves: No startTransition + root component + 1000ms Promise in state + use ```js import { use, useState } from "react"; import { createRoot } from "react-dom/client"; const rootElement = document.getElementById("root"); const root = createRoot(rootElement); function Foo() { const [promise, setPromise] = useState( new Promise((resolve) => { setTimeout(() => { resolve(<h1>hi</h1>); }, 1000); }) ); return use(promise); } root.render(<Foo />); ``` https://codesandbox.io/s/blue-butterfly-3xywp2?file=/src/index.js:0-400
open
gaearon
2023-06-01T15:25:07
2026-03-25T14:29:01
null
[ "Type: Bug" ]
null
0
{ "+1": 1, "heart": 1 }
1
false
2026-03-29T04:53:23.797326
facebook
react
25,886
I_kwDOAJy2Ks5ZRLNd
false
Bug: Rendering <Suspense> outside <body> should error
Expected: it should error Actual: it doesn't Possibly related: https://github.com/facebook/react/issues/25710#issuecomment-1352456042. In a standalone project, I've only managed to repro `<!--$-->` before doctype, but not between doctype and html as in the repro from that issue. I haven't confirmed that this is the actual cause of #25710, but at the very least we should have errored there as well.
closed
completed
gaearon
2022-12-15T02:09:43
2026-03-25T14:30:56
2026-03-25T14:30:56
[ "Type: Bug", "Component: Server Rendering" ]
null
0
{}
2
false
2026-03-29T04:53:23.844743
facebook
react
21,139
MDU6SXNzdWU4NDQ0NTI1MDc=
false
[Fast Refresh] Don’t Scan the Tree
We had a conversation with @sebmarkbage about https://github.com/facebook/react/issues/20417. He had a different implementation idea that should resolve such issues. I probably won't do this now but I want to write it down for future reference. Currently, after we gather a list of types that need to be updated in the tree, we scan the tree and tag Fibers to be updated. This happens [here](https://github.com/facebook/react/blob/0853aab74dc8285401e62d1e490551ba3c96fd64/packages/react-reconciler/src/ReactFiberHotReloading.new.js#L267-L339). But like https://github.com/facebook/react/issues/20417 shows, this doesn't work if the type is not in the tree. E.g. if the function we changed is only being called directly, and its "type" is not the actual wrapper that exists in the tree. An alternative implementation could instead inject a special Hook call into each registered component. For example by generating a wrapper. That Hook would return the latest actual implementation, _and_ schedule updates on itself when it changes. Which means there would be no need to scan the tree at all. Instead, each component would register itself for updates. For false positives outside of React rendering, the Hook would just be callthrough so it wouldn't break anything. This seems like a pretty significant change to the implementation so I'm probably not going to work on this now. Maybe we could consider it next time we need to change the implementation details. Or maybe somebody sufficiently motivated wants to hack on this. I can provide some code pointers but it’s not a beginner-friendly issue.
open
gaearon
2021-03-30T12:17:17
2026-03-25T14:29:51
null
[ "Difficulty: challenging", "Component: Fast Refresh", "Resolution: Backlog", "React Core Team" ]
null
0
{ "+1": 4 }
3
false
2026-03-29T04:53:23.885342
facebook
react
18,930
MDU6SXNzdWU2MTg4ODkwNTM=
false
Bug: eslint-react-hooks asking (exhaustive-deps) asking for the full object instead of the property that is being used on useEffect
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ``` "react": "^16.13.1", "react-dom": "^16.13.1", devDependencies "eslint": "^7.0.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-module-utils": "^2.6.0", "eslint-plugin-import": "^2.20.2", "eslint-plugin-react": "^7.19.0", "eslint-plugin-react-hooks": "^4.0.0", ``` ## Steps To Reproduce This code: ``` function MyComponent() { const lastPathname_ref = useRef(null); const location = {pathname: ""}; useEffect(() => { lastPathname_ref.current = location.pathname; },[]); } ``` <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/s/solitary-currying-htsp3 <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior This very same code is asking for different variables in the dependency array: On CodeSandbox, it's asking for `location.pathname`, which is correct and is the intended behavior of my `useEffect`. ![image](https://user-images.githubusercontent.com/43407798/82043496-990fb300-96a3-11ea-9ea3-3ea87e79bf1d.png) On my local environment (using the versions I've mentioned above), it's asking for the full `location` object. Which I think it's not correct, and that is not what I need. ![image](https://user-images.githubusercontent.com/43407798/82043569-ba709f00-96a3-11ea-874e-121297d06b43.png) I don't know what versions the CodeSandbox environment is using. ## The expected behavior It should be asking for the `location.pathname` property, instead of the full `location` object. ## NOTE This issue seems to be different than https://github.com/facebook/react/issues/16265 , because that one is caused when you call a method straight from the object, without destructuring it first. This issue is happening when using a property, not a method.
closed
completed
cbdeveloper
2020-05-15T11:10:25
2026-03-24T23:22:03
2020-07-27T16:01:14
[ "Status: Unconfirmed" ]
null
0
{ "+1": 4 }
13
false
2026-03-29T04:53:23.926266
facebook
react
35,349
I_kwDOAJy2Ks7dyvjM
false
Bug: Can't really access component stack `errorInfo.componentStack` on server
React version: 19.2.2 On the server-side, upon a boundary error, the component stack can be accessed via `onError(err, errorInfo) => errorInfo.componentStack` but this has limited (no?) value because the general recommendation is to swallow boundary errors and let the client-side throw the error instead (if it fails again on the client-side). The real value AFAICT would be to access the component stack upon shell errors, but I don't see a way to access `error.componentStack`: - The `onShellError()` callback of [`renderToPipeableStream()`](https://react.dev/reference/react-dom/server/renderToPipeableStream) doesn't receive `errorInfo.componentStack`. - Shell errors thrown while [`renderToReadableStream()`](https://react.dev/reference/react-dom/server/renderToReadableStream) also seem to be missing `errorInfo.componentStack`. ## Context I'm the author of [`react-streaming`](https://github.com/brillout/react-streaming) which powers [`vike-react`](https://vike.dev/vike-react) amongst others.
open
brillout
2025-12-11T21:46:21
2026-03-25T18:57:01
null
[ "Status: Unconfirmed" ]
null
0
{}
3
false
2026-03-29T04:53:23.998629
facebook
react
36,003
I_kwDOAJy2Ks7xvWxI
false
[Fizz] Bug: Nested suspense boundary with suspended fallback: "A previously unvisited boundary must have exactly one root segment"
There's a bug in a nested Suspense where the inner fallback itself suspends (via use() on a delay promise), and the inner content resolves before the fallback. Fizz mis-tracks boundary segments during the transition from "pending with suspended fallback" to "completed." This is a useful pattern for when you want to create a `DeferredSuspense` boundary that blocks for a pre-set amount of time and then flushes. If the period passes and the children have not un-suspended, we flush the alternate boundary to the client. I am aware this a cursed use of suspense, but it should be valid imo. React version: 19.2.4 ## Steps To Reproduce 1. `$ node nested-suspense-bug-repro.mjs` Link to code example: https://gist.github.com/switz/45d7c9f49953e11de7eec9d737841e2e#file-nested-suspense-bug-repro-mjs ## The current behavior ``` $ node nested-suspense-bug-repro.mjs onError: A previously unvisited boundary must have exactly one root segment. This is a bug in React. Bug triggered: A previously unvisited boundary must have exactly one root segment. This is a bug in React. ``` ## The expected behavior When content resolves FAST (before ms): - No fallback is ever shown — content renders directly When content resolves SLOW (after ms): - For the first ms milliseconds, nothing visible changes (outer Suspense holds) - After ms, the fallback appears (inner Suspense fallback delay resolves, outer Suspense can now show its content which includes the pending inner boundary with its fallback) - When content finally resolves, it replaces the fallback via streaming The basic mechanics: ``` <Suspense fallback={fallback}> ← outer: catches if inner fallback suspends <Suspense fallback={<Delay ms={200}>{fallback}</Delay>}> ← inner: delay on fallback {children} ← the actual async content </Suspense> </Suspense> ``` 1. Children suspend → inner Suspense tries its fallback 2. Fallback has <Delay ms={200}> which also suspends → outer Suspense catches both 3. If children resolve before 200ms → inner boundary completes, outer shows content directly (no fallback flash) 4. If 200ms elapses first → delay resolves, outer can now render (shows inner's fallback), children stream in later The bug is in case 3 — Fizz crashes instead of rendering the content directly.
closed
completed
switz
2026-03-11T04:33:59
2026-03-25T19:06:00
2026-03-11T12:18:28
[ "Status: Unconfirmed" ]
null
0
{}
6
false
2026-03-29T04:53:24.064069
facebook
react
36,016
I_kwDOAJy2Ks7yJgt2
false
Bug: eslint-plugin-react-hooks Typescript types are broken
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. npm i eslint-plugin-react-hooks 2. configure TypeScript to strict mode, 3. use plugin in `eslint.config.ts` like `pluginReact.configs.flat.recommended` 4. See error: ``` Type 'ReactFlatConfig | undefined' is not assignable to type 'InfiniteArray<ConfigWithExtends>'. Type 'undefined' is not assignable to type 'InfiniteArray<ConfigWithExtends>'. ``` <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Forced to use non-null assertion but it is banned in my eslint config =) ## The expected behavior Types can declare each existing property of `flat` object
open
krutoo
2026-03-12T06:45:53
2026-03-25T18:45:00
null
[ "Status: Unconfirmed" ]
null
0
{}
7
false
2026-03-29T04:53:24.290938
facebook
react
31,446
I_kwDOAJy2Ks6dYDTQ
false
Bug: eslint-plugin-react-hooks@5.0.0 only detects english component names
React version: eslint-plugin-react-hooks@5.0.0 ## Steps To Reproduce 1. Create a functional component with a name such as `ÄndraVärde` that starts with a non english upper case letter 2. Run the linter ## The current behavior Sample error: > 23:20 error React Hook "useSelectedState" is called in function "ÄndraVärde" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use" react-hooks/rules-of-hooks ## The expected behavior The linting should allow non english component names, React does. ## The problem Version 5.0.0 included the changes made in #25162 which modified the following method: https://github.com/facebook/react/blob/e1378902bbb322aa1fe1953780f4b2b5f80d26b1/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js#L43-L50 This code only allows english upper case letters `A-Z` which is not enough. ## Proposed solution Use `.toUpperCase()` and compare the result: ```js function isComponentName(node) { return node.type === 'Identifier' && node.name[0] == node.name[0].toUpperCase(); } ``` This should work with a lot more languages at least.
open
DavidZidar
2024-11-07T08:56:14
2026-03-25T19:21:02
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 3 }
14
false
2026-03-29T04:53:24.421954
facebook
react
35,713
I_kwDOAJy2Ks7o7-fp
false
[DevTools Bug] Cannot remove node "1052" because no matching node was found in the Store.
### Website or app Private App ### Repro steps Try to profile, get the error ### How often does this bug happen? Every time ### DevTools package (automated) react-devtools-extensions ### DevTools version (automated) 7.0.1-3cde211b0c ### Error message (automated) Cannot remove node "1052" because no matching node was found in the Store. ### Error call stack (automated) ```text at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:726672 at p.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:680330) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:682241 at bridgeListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1189368) ``` ### Error component stack (automated) ```text ``` ### GitHub query string (automated) ```text https://api.github.com/search/issues?q=Cannot remove node because no matching node was found in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react ```
open
machineghost
2026-02-06T18:57:59
2026-03-25T19:06:01
null
[ "Type: Bug", "Status: Unconfirmed", "Component: Developer Tools" ]
null
0
{ "+1": 5, "heart": 2 }
10
false
2026-03-29T04:53:24.488704
facebook
react
35,984
I_kwDOAJy2Ks7xQT3I
false
Bug: react-hooks/static-components false positive
eslint-plugin-react-hooks: 7.0.1 ## Steps To Reproduce 1.Create react app 2. Add this `eslint-plugin-react-hooks` plugin 3. Lint the next code ```tsx import { FeatureRemovalBuildTime } from '@xxx/build-time-tools/FeatureRemovalBuildTime'; import { PlatformSwitchBuildTime } from '@xxx/build-time-tools/PlatformSwitchBuildTime'; import { isMyFeature } from '@xxx/config/exporter'; import ErrorMessageMT from './ErrorMessageMT'; import ErrorMessageBase from './ErrorMessageBase'; import type { ErrorMessageProps } from './types'; const ErrorMessage = (props: ErrorMessageProps) => { 'use memo'; const ErrorMessageView = PlatformSwitchBuildTime.select({ anyMT: FeatureRemovalBuildTime.isMyFeature && isMyFeature() ? ErrorMessageMT : ErrorMessageBase, default: ErrorMessageBase, }); return <ErrorMessageView {...props} />; // Error: react-hooks/static-components }; export default ErrorMessage; ``` ## The current behavior Eslint will complain that `ErrorMessageView` was created during the render ## The expected behavior But all values inside if check are stable and valid as in this example: https://react.dev/reference/eslint-plugin-react-hooks/lints/static-components#valid
open
retyui
2026-03-09T19:52:41
2026-03-25T19:21:19
null
[ "Status: Unconfirmed" ]
null
0
{}
3
false
2026-03-29T04:53:24.540751
facebook
react
35,395
I_kwDOAJy2Ks7fdwJV
false
Perf: react-hooks ESLint plugin (eslint-plugin-react-hooks) rules are extremely slow, dominating lint time
# react-hooks ESLint plugin rules are extremely slow, dominating lint time - React version: `react@19.2.3` - `eslint-plugin-react-hooks` version: `eslint-plugin-react-hooks@7.0.1` - `eslint` version: `eslint@9.39.1` ## Steps To Reproduce 1. Install `eslint-plugin-react-hooks` (the React Compiler ESLint plugin) 2. Enable the recommended plugin rules: e.g. `reactHooksPlugin.configs.flat.recommended, jstsFiles` 3. Run ESLint with `TIMING=50` on a large codebase (~15k+ files) 4. Observe that `react-hooks/static-components` takes 42-56% of total lint time ## Link to code example Unfortunately, we cannot share a minimal reproduction as this occurs on a large proprietary codebase. However, the performance data should be reproducible on any sufficiently large React codebase. ## The current behavior When running ESLint with the `TIMING` flag on our codebase, the `react-hooks` plugin rules dominate lint time: ``` Rule | Time (ms) | Relative :------------------------------------------|-----------:|--------: react-hooks/static-components | 393394.236 | 56.2% unused-imports/no-unused-imports | 62579.162 | 8.9% redos-detector/no-unsafe-regex | 35114.790 | 5.0% import/named | 24641.617 | 3.5% react-hooks/rules-of-hooks | 16596.903 | 2.4% ... ``` **Key findings:** - `react-hooks/static-components` takes **~393 seconds** (6.5 minutes) — more than **5x longer** than the next slowest rule - The react-hooks plugin nearly **doubles total lint time**: ~3 minutes without the plugin vs ~6 minutes with it enabled - With 4x parallelism (`--concurrency=4`), total ESLint time goes from ~190 seconds to ~370 seconds when the plugin is enabled - Even if we disable `react-hooks/static-components`, another rule jumps up to take the top spot. It seems to trigger from the plugin itself, not any particular rule. ## The expected behavior The `react-hooks` rules should have comparable performance to other ESLint rules. A single rule taking 42-56% of total lint time and being 5x slower than any other rule suggests there may be optimization opportunities in the rule implementation. --- **Impact:** This performance issue significantly affects CI pipeline times and local development experience. We're considering running these rules as a separate parallel step or disabling them entirely, which isn't ideal.
open
jordan-cutler
2025-12-19T22:30:46
2026-03-25T19:21:01
null
[ "Type: Feature Request", "Component: React Compiler", "Component: ESLint Rules" ]
null
0
{ "+1": 30 }
19
false
2026-03-29T04:53:24.636543
facebook
react
32,950
I_kwDOAJy2Ks6y7ReY
false
[Compiler Bug]: Coverage report shows missing branch coverage
### What kind of issue is this? - [ ] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [x] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://github.com/ValentinGurkov/vitest-react-compiler-missing-coverage-repro ### Repro steps ### Describe the bug Hello, I've been testing out the new React compiler and have noticed that the code coverage report becomes incorrect with the compiler turned it. I believe it may be related to the way it changes the output react component code. I've created a minimal reproduction repository to demonstrate the issue: 👉 https://github.com/ValentinGurkov/vitest-react-compiler-missing-coverage-repro, but I also want to share my findings here: The button we are going to test is a simple one: ```tsx export const Button = () => { return <button>Click me</button>; }; ``` As well as its test: ```tsx import { page } from '@vitest/browser/context'; import { Button } from '@repo/components/ui/button.js'; import { describe, expect, it} from 'vitest'; import { render } from 'vitest-browser-react'; describe(Button, () => { it('renders with default variants', async () => { render(<Button />); const button = page.getByRole('button', { name: 'Click me' }); await expect.element(button).toBeInTheDocument(); }); }); ``` The coverage report with the React compiler turned on looks like: ```pgsql ✓ browser (chromium) test/components/ui/button.test.tsx (1 test) 9ms ✓ Button > renders with default variants 9ms Test Files 1 passed (1) Tests 1 passed (1) Start at 20:34:46 Duration 632ms (transform 0ms, setup 133ms, collect 28ms, tests 9ms, environment 0ms, prepare 93ms) % Coverage report from v8 ------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ------------|---------|----------|---------|---------|------------------- All files | 100 | 50 | 100 | 100 | button.tsx | 100 | 50 | 100 | 100 | 2 ------------|---------|----------|---------|---------|------------------- ``` The component has no branching logic while the report shows are the are missing some. I believe I've managed to set up the `vitest` configuration to also log the transformed component and we have: ```jsx import { jsxDEV } from "react/jsx-dev-runtime"; import { c as _c } from "react/compiler-runtime"; export const Button = () => { const $ = _c(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = /* @__PURE__ */ jsxDEV("button", { children: "Click me" }, void 0, false, { fileName: "/Users/<my-user>/Projects/vitest-react-compiler-coverage/src/components/ui/button.tsx", lineNumber: 6, columnNumber: 10 }, this); $[0] = t0; } else { t0 = $[0]; } return t0; }; ``` It looks like the React compiler introduces a conditional for memoization purposes. That may explain the coverage issue, though it raises the question: is it even possible to get 100% branch coverage for components compiled like this? The test without the React compiler looks like: ```diff - react({ - babel: { - plugins: [ - ["babel-plugin-react-compiler", {}] - ], - }, - }), + react(), ``` ```pgsql ✓ browser (chromium) test/components/ui/button.test.tsx (1 test) 10ms ✓ Button > renders with default variants 10ms Test Files 1 passed (1) Tests 1 passed (1) Start at 20:36:42 Duration 490ms (transform 0ms, setup 36ms, collect 6ms, tests 10ms, environment 0ms, prepare 92ms) % Coverage report from v8 ------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ------------|---------|----------|---------|---------|------------------- All files | 100 | 100 | 100 | 100 | button.tsx | 100 | 100 | 100 | 100 | ------------|---------|----------|---------|---------|------------------- ``` The code coverage is 100% as expected. The output code also has no conditions: ```jsx import { jsxDEV } from "react/jsx-dev-runtime"; export const Button = () => { return /* @__PURE__ */ jsxDEV("button", { children: "Click me" }, void 0, false, { fileName: "/Users/<my-user>/Projects/vitest-react-compiler-coverage/src/components/ui/button.tsx", lineNumber: 2, columnNumber: 12 }, this); }; ``` Coming from https://github.com/vitest-dev/vitest/issues/7843#issuecomment-2812107855, it seems that babel's `auxiliaryCommentBefore` also does not have any effect on this. How do we see test coverage working once the React Compiler becomes standard? ### How often does this bug happen? Every time ### What version of React are you using? 19.1.0 ### What version of React Compiler are you using? 19.1.0-rc.1
open
ValentinGurkov
2025-04-17T09:00:56
2026-03-25T19:21:13
null
[ "Type: Bug", "Status: Unconfirmed", "Component: React Compiler" ]
null
0
{ "+1": 9 }
28
false
2026-03-29T04:53:24.707956
facebook
react
35,973
I_kwDOAJy2Ks7wmOYa
false
[Compiler Bug]: ref initialization using `=== null` doesn't work with impure functions
### What kind of issue is this? - [ ] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [x] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://eslint-online-playground.netlify.app/#eNqlVM1um0AQfpXRXupExNydOmqlJGpOrZKqPQQfKAx442UX7U/iyELqQ/QJ+ySdYbENbtRLhQ1o99tvvvlmhp1wtkhxmzetwvmT24qFkE1rrIcdBIf3WCX8vKkqLDx0UFnTQCYs5oXPxGWm+aqCLrw0Gr4EizeRbHYGu0wD8L8w2nmwWMFyIJ3poNQZHQeQFcxoa14Ea1F7WC6X0O/G8wBpCodFKNZYbKA06PQ7D97KukbbU0tND12ijacmlKS4FwvQ8Y0YTfBOlgh+jUdy6QGtNdYx6JRAmxaJpt/xwWp4X8rnq5YyptB08sXYjXuf8iJFojh8sfa7pgdV5Jixr/D75y/mdmCDQsiVMi8uAYJI/xrXbu/ubx5GrkaCE1//z9Npcte5x7k2L7OzS/amL+7F2piNSwddvS2wRouDifw49MWMRC2v9tyszFA3KVPPMtGYoD2WkFO7JOO4UWmXwOOKX0+NpS48WPtDmWKD5dRctpYUPHgS35ufWwpV9v6O3YwOj+z8fsC+aenjoPijX0Vr+whDikenovyx4qOGo1CRCHRKaj8n8krWNGLHCet9/sQ278cqYi9aFWqpL0Z1GEYNt/3BEqs8KJLKEgbXK6nQLWhJnJ+n5/Pdk0tonBPv6LftMrFKIi5yE3K3H+N9hMVYUDfAVa7rkNf4uWXv+FhcJ6LcOrR/rwNg0eTf0DraWFAQRZ45rv4R4UywBX59bZEBjSmpUBMAU9xiTuZyUjugVBY07QEPwrh14tv+ydUeC5mkNzQyZ0k2czeP4k2RPJxv4WIcvq8uqa5tXmzIGKqo0VTT+LETnnKKhydZZaLE52ts+QOlC4l9gEFpJj7EuqdPQ9wTx/Z98c/NN5tmjD8Mbie6P5C2ABI= ### Repro steps See the link for playground. Basically, the ref-in-render rule doc states that this very specific access is allowed: Example 1: ```jsx // ✅ Lazy initialization of ref value function Component() { const ref = useRef(null); // Initialize only once on first use if (ref.current === null) { ref.current = expensiveComputation(); // OK - lazy initialization } ``` However, if `expensiveComputation` is impure, it still fires. Example 2: ```jsx if (ref.current === null) { ref.current = Date.now(); // purity rule ``` And of course, `useState(() => Date.now())` is fine. The react docs say ``` // It only runs once when the hook is called, so only the current date at the // time the hook is called is set first. ``` Between those three, I'd expect my second example to be valid, but it's not? ### How often does this bug happen? Every time ### What version of React are you using? 19.0.1 ### What version of React Compiler are you using? 1.0.0
open
simarmol
2026-03-06T23:02:39
2026-03-25T19:21:16
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{ "heart": 2 }
5
false
2026-03-29T04:53:24.746872
facebook
react
35,460
I_kwDOAJy2Ks7h0USy
false
Bug: In React 19.2 Suspense renders fallback instead of children if children are too big
We use `Suspense` component in NextJs project to catch server side errors in components and to prevent ruining the whole page as [recommended here](https://react.dev/reference/react/Suspense#providing-a-fallback-for-server-errors-and-client-only-content). In React 19.1 `Suspense` just renders children on page rendered on server side without JS. So if user without JS opens page, he gets regular page with the content. In React 19.2 `Suspense` renders fallback and never renders children on page rendered on server side without JS. So now if user without JS opens page, he gets blank page. It seems like `Suspense` does not render children if they are too big while it works fine for smaller children. We are relying on `Suspense` behaviour from React 19.1 to keep page content accessible to non-JS users so we would like to know if new `Suspense` behaviour is standard now? If yes, if there any recommended way to capture server side rendering errors like `Suspense` does? <!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19.2.3 ## Steps To Reproduce 1. Run this project locally https://github.com/yoksel/suspense-issue and open it in browser 2. Switch off JS and reload the page to see the result of server side rendering 3. Check the first demo and see that `Suspense` shows fallback instead of children if the children are too big. 4. Check the second demo and see that `Suspense` shows children if the children are small. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://github.com/yoksel/suspense-issue <img width="865" height="965" alt="Image" src="https://github.com/user-attachments/assets/53520133-d587-4373-904e-a5dd41539a0a" /> <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior When children are too big, `Suspense` renders fallback instead on page without JS even if there is no server errors in component ## The expected behavior `Suspense` renders children if there is no server errors in component on page without JS
open
yoksel
2026-01-07T12:36:45
2026-03-25T19:21:10
null
[ "Status: Unconfirmed" ]
null
0
{ "heart": 3 }
6
false
2026-03-29T04:53:24.786685
facebook
react
35,722
I_kwDOAJy2Ks7pNdps
false
[eslint-plugin-react-hooks] sync plugin version with package.json
The version in `packages/eslint-plugin-react-hooks/src/index.ts` is currently hardcoded as a string (e.g., `'7.0.0'`). This violates the Single Source of Truth (SSOT) principle for version management. While `scripts/shared/ReactVersions.js` manages package versions during the release process and updates `package.json`, it does not update this hardcoded string in the source file. Since this package is published without a bundling step that injects the version (based on the `files` field in `package.json`), it relies on manual updates, which are prone to human error and version mismatches. **React version:** `main` branch ## Steps To Reproduce 1. Go to `packages/eslint-plugin-react-hooks/src/index.ts` in the main branch. 2. Check the `meta.version` property in the exported plugin object. 3. Observe that it is a hardcoded string rather than a dynamic reference to `package.json`. **Link to code example:** https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/index.ts ## The current behavior The version is explicitly hardcoded in the source file, which creates a risk of metadata inconsistency if the release script updates `package.json` but misses this file. ```typescript // Current implementation const plugin = { meta: { name: 'eslint-plugin-react-hooks', version: '7.0.0', // Hardcoded string }, rules, configs, }; ``` ## The expected behavior Since ESLint plugins run in a Node.js environment, the version should be dynamically retrieved from `package.json`. This ensures that the runtime version always matches the published package metadata without requiring manual synchronization or complex build injections. Since the codebase uses TypeScript with ES modules, we should use `import` to dynamically load the version, which is the idiomatic approach in TypeScript/ESM for ensuring SSOT. ```typescript // Proposed change import pkg from '../package.json'; const plugin = { meta: { name: 'eslint-plugin-react-hooks', version: pkg.version, // Dynamic reference from package.json }, rules, configs, }; export default plugin; ``` **References:** [ESLint official documentation on Plugin Metadata](https://eslint.org/docs/latest/extend/plugins#meta-data-in-plugins). While the documentation shows various examples, the principle of dynamically sourcing metadata from `package.json` is a recommended best practice for maintaining version consistency.
open
rhehfl
2026-02-08T12:13:39
2026-03-25T19:22:58
null
[ "Status: Unconfirmed" ]
null
0
{ "heart": 2 }
2
false
2026-03-29T04:53:24.828379
facebook
react
33,361
I_kwDOAJy2Ks64fTCH
false
Bug: formMethod specified on the submit button doesn't override the method from useFormStatus.
React version: 19.1 When using formMethod on a submit button (<button type="submit" formMethod={"post"}> or <input type="submit" formMethod={"post"}>), it should override the parent form's method. However, it does not. ## Steps To Reproduce 1. Open example (link below) 2. Click to any "Submit button" 3. under the text input field will "method" will be shown. Link to code example: https://codesandbox.io/p/sandbox/react-dev-forked-ks99yw ## The current behavior Displayed method: dialog ## The expected behavior Displayed method: post
open
levkovich2806
2025-05-27T21:01:13
2026-03-25T19:21:07
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 2, "heart": 2 }
13
false
2026-03-29T04:53:24.861827
facebook
react
35,991
I_kwDOAJy2Ks7xf_h4
false
[Compiler Bug]: Overloads cause wrong function to be exported with gating
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEwBUYCAynrggQL4EBmMEGBAOiAHScD0YVMBGD4CEHANxsAdtIQAPHPkZQpcPGghSSZckLAapACgCUyArrD7NBAD4EpUADaPJU+YsIMVag9op6DAB4AFQA+QzJHBDVcMwiAzTMLKyljAgBeUIJg02zbeycXWQVcT291a1J-SyCww2kCAkjogQB+OLIaxPME1Iys4Olc5N87YPyHZyIGgkE8WC0qympDCLTM6a1GgjhNfibejKbOTpTXbYI0BgJDAEJTgzS5hYLnc+3nmC1mmJgCVoOUV+8S6fTMD0071oxlctBAABoQLspAw0ABzFDobClAh4ACeWBoxAACo4oGi0FIAPJYCpSMB0RjMVgAcgARgBDNkIRwAWiwZIpUl5gg5al5u2waCiMB4ABM0PwWa5pIZgDM0Rz1FI0WZ1VtGpBYIgzBwAEoIMV4ADCLCw0oQMAAYpb5oInY4OWiwBx4TNGpgPORCXArmhHQA5DkYBCm9BgW1SmUAUSkXKict9M1ofqk9DAWsVqKEBFJ5MpNLpYBhCPAAAsIAB3ACSUjwjrTjjAKAYHK7CFoQA ### Repro steps 1. Compile a function with TypeScript overload signatures with gating enabled: ```ts import { useStore } from "../stores/store"; // Overload signatures export function useSession(): Session | null; export function useSession<T>(selector: (session: Session) => T): T | null; // Implementation export function useSession<T>( selector?: (session: Session) => T ): Session | T | null { return useStore((s) => { const session = s.session; if (!session) return null; return selector ? selector(session) : session; }); } ``` 2. The presence of overload signatures causes `export` to be placed on the wrong function: ```ts // Wrong - unoptimized variant is exported export function useSession_unoptimized<T>(...) { ... } // Wrong - dispatcher is not exported function useSession(arg0) { ... } ``` **Expected:** `useSession` should be exported, not `useSession_unoptimized` ### How often does this bug happen? Every time ### What version of React are you using? 19.2.4 ### What version of React Compiler are you using? 1.0.0
open
danteissaias
2026-03-10T13:06:53
2026-03-25T19:23:02
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:24.908949
facebook
react
35,997
I_kwDOAJy2Ks7xpzU5
false
Bug: False postive react-hooks/refs
Since React 19 devs can pass `ref` directly as a prop (forwardref is not needed anymore) , but now `eslint-plugin-react-hooks` is complaining about valid code <img width="1156" height="658" alt="Image" src="https://github.com/user-attachments/assets/19b68b28-c546-4066-8de1-54d663cda135" /> --- React version: 19.1.1 eslint-plugin-react-hooks: 7.0.1 ## Steps To Reproduce ```tsx import type { Ref } from 'react'; import { StyleProp, TextInput as RNTextInput, TextInputProps, TextStyle, } from 'react-native'; import { TextInput } from '../TextInput'; function TextArea( props: TextInputProps & { ref?: Ref<RNTextInput | null>; style?: StyleProp<TextStyle>; }, ) { return ( <TextInput ref={props.ref} // Eslint error: react-hooks/refs type="body" /> ); } export { TextArea }; ``` ## The current behavior Error `ref={props.ref} // Eslint error: react-hooks/refs` ## The expected behavior No error, valid react 19 code
open
retyui
2026-03-10T21:15:20
2026-03-25T19:23:00
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 4 }
4
false
2026-03-29T04:53:24.974163
facebook
react
26,608
I_kwDOAJy2Ks5jNxhc
false
Bug: MessageChannel in Scheduler prevents Jest test from exiting
React version: any Scheduler version: any up to current (0.23.0) ## Steps To Reproduce 1. Create Jest unit test. 2. Select JSDom as test environment so that runtime will not have `setImmediate` function. 3. JSDom still does not implement `MessageChannel` https://github.com/jsdom/jsdom/issues/2448. If `MessageChannel` is required to test some important functionality, one can add an implementation from Node.js as recommended in comment https://github.com/jsdom/jsdom/issues/2448#issuecomment-536242756 ```js window.MessageChannel = require('node:worker_threads').MessageChannel; ``` 4. Add Scheduler or React as a dependency and require it in the test or one of the files under test. 5. Run test Link to code example: https://github.com/victor-homyakov/scheduler-jest-jsdom-example ## The current behavior Test is endless. Jest won't stop. Console shows a message ``` Jest did not exit one second after the test run has completed. 'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue. ``` Running Jest with `--detectOpenHandles` outputs: ``` Jest has detected the following 1 open handle potentially keeping Jest from exiting: ● MESSAGEPORT > 1 | require('scheduler'); | ^ at node_modules/scheduler/cjs/scheduler.development.js:569:17 ``` ## The expected behavior Code at https://github.com/facebook/react/blob/5426af3d50ff706f3ebeb4764f838e0a3812bf9a/packages/scheduler/src/forks/Scheduler.js#L621 should `unref` the handle: ```js channel.port1.onmessage = performWorkUntilDeadline; // Allow the thread to exit if this is the only active handle in the event system if (channel.port1.unref) { channel.port1.unref(); } ```
open
victor-homyakov
2023-04-12T13:18:32
2026-03-25T19:23:05
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 3 }
22
false
2026-03-29T04:53:25.084279
facebook
react
35,983
I_kwDOAJy2Ks7xNKqQ
false
Bug: `<ViewTransition>` name-prop change does not trigger view transition without child DOM mutation
A `<ViewTransition>` whose `name` prop changes between renders does **not** trigger the view transition update pipeline unless a child DOM mutation also occurs. Hero morphs via name-prop toggling on mounted components silently produce no animation. ## React version - `react`: `19.3.0-canary-46103596-20260305` - `react-dom`: `19.3.0-canary-46103596-20260305` ## Steps to reproduce 1. Mount two `<ViewTransition>` boundaries wrapping a button and a dialog 2. Toggle the `name` prop between them (one gets `"camera-hero"`, the other `undefined`) via `startTransition` + `addTransitionType` 3. No child DOM mutations occur during the transition **Reproduction repo:** https://github.com/kjanat/react-canary-19.3.0-view-transition-bug **Live preview:** https://kjanat.github.io/react-canary-19.3.0-view-transition-bug/ **CodeSandbox:** https://codesandbox.io/p/sandbox/yx5sdy Toggle between **Broken** and **Workaround** modes to see the difference. Minimal repro component: ```tsx <ViewTransition name={heroOwner === 'button' ? 'camera-hero' : undefined} share="camera-hero-morph" default="none" > <button>Use live camera</button> </ViewTransition> <ViewTransition name={heroOwner === 'dialog' ? 'camera-hero' : undefined} share="camera-hero-morph" default="none" > <dialog ref={dialogRef}>{modalContent}</dialog> </ViewTransition> ``` The `heroOwner` state toggles between `'button'` and `'dialog'` inside `startTransition` with `addTransitionType('camera-modal')`. ## Expected behavior Opening the modal morphs smoothly from the trigger button to the dialog (shared `camera-hero` element with CSS view-transition animations). ## Actual behavior Modal appears instantly -- no hero morph animation. See [root cause &sect;1](#1-name-only-changes-do-not-produce-update) for the code path that leads to a zero-opacity cancellation. ### Workaround Two changes required simultaneously (visible in workaround mode in the reproduction): 1. **`update` prop** -- unblocks VT processing (otherwise `default='none'` gates it out): ```tsx update={{ default: 'none', 'camera-modal': 'camera-hero-morph' }} ``` 2. **Forced child DOM mutation** -- sets the internal `Update` flag on the VT fiber: ```tsx <button data-hero-owner={heroOwner}>Use live camera</button> ``` The `data-hero-owner` attribute serves no purpose other than forcing a child DOM mutation that sets a flag which logically should depend on the name change itself. ## Root cause (source references) All references below are GitHub permalinks to React commit [`4610359651fa10247159e2050f8ec222cb7faa91`][react-commit], matching `react-dom@19.3.0-canary-46103596-20260305`. ### 1. Name-only changes do not produce `Update` In [`measureViewTransitionHostInstancesRecursive`][measure-recursive], the `Update` flag gates whether `applyViewTransitionName` fires for the new snapshot: ```js (parentViewTransition.flags & Update) !== NoFlags && applyViewTransitionName(instance, newName, className); ``` In this code path, the `Update` flag is set in the mutation phase ([`ReactFiberCommitWork.js#L2634-L2645`][update-flag-set]) when `viewTransitionMutationContext` is `true`: ```js viewTransitionMutationContext && (finishedWork.flags |= Update); ``` `viewTransitionMutationContext` becomes `true` when a DOM mutation (attribute change, text change, element insertion/removal) occurs within the VT's child subtree during the mutation commit. The `Update` flag can also be set during measurement if `hasInstanceChanged()` detects a bounding-rect change ([L676-681][has-instance-changed]), but in this scenario (name-only prop change, no layout shift), measurements are identical and this path returns false. When only the VT's `name` prop changes, with no child mutations and no layout change, the flag stays `NoFlags`. Without `Update`, the instance is not passed to `applyViewTransitionName` but is instead pushed to `viewTransitionCancelableChildren`, which leads to a zero-opacity cancellation path in [`ReactFiberConfigDOM.js#L1616-L1640`][cancel-animation]: ```js current.animate( { opacity: [0, 0], pointerEvents: ['none', 'none'] }, { duration: 0, fill: 'forwards', pseudoElement: '::view-transition-group(' + oldName + ')' }, ); ``` > **Note:** this cancellation path is only reachable when the `update` prop unblocks before-mutation snapshot capture and after-mutation measurement. With `default='none'` and no `update` prop, host instances never receive VT names in the first place, so they never reach `viewTransitionCancelableChildren`. The zero-opacity cancellation manifests specifically in the partial-workaround state (setting `update` without also forcing a DOM mutation). React already detects the name change in `beginWork` at [`ReactFiberBeginWork.js#L3617-L3622`][name-change-detected]: ```js if (current !== null && current.memoizedProps.name !== pendingProps.name) { workInProgress.flags |= Ref | RefStatic; } ``` This sets `Ref | RefStatic` for ref lifecycle, but it does not propagate into the commit phase as a VT update signal. ### 2. `default='none'` gates out the update path (compounding) The `share` prop name suggests it controls shared-element/hero morphs, but in the source it is consulted in the **enter/exit pair** path ([`commitEnterViewTransitions`][commit-enter] and [`commitExitViewTransitions`][commit-exit]) and not in the update path. When both VTs stay mounted and only change their `name` prop, React routes through the **update** path, which calls `getViewTransitionClassName(props.default, props.update)` in two phases: | Phase | Source permalink | Gate | | --------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------- | | Before-mutation | [`ReactFiberCommitViewTransitions.js#L489-L513`][before-mutation-gate] | Class name `=== 'none'` &rarr; skip old-snapshot VT name application | | After-mutation | [`ReactFiberCommitViewTransitions.js#L768-L803`][after-mutation-gate] | Class name `=== 'none'` &rarr; skip measurement and new-snapshot VT name | The mutation phase ([`ReactFiberCommitWork.js#L2623-L2633`][update-mutation-gate]) also checks the class name to set `inUpdateViewTransition`, but this variable controls Portal context propagation in the traced code path -- the `Update` flag assignment at [L2634-L2645][update-flag-set] is gated by `viewTransitionMutationContext`, not by the class name.\ So `default='none'` blocks the before/after-mutation phases, while the missing DOM mutation independently blocks the `Update` flag. ### 3. Separate observation: `share` not consulted in update path The `share` prop is only consulted in the enter/exit pair path and not in the update path. This may be by-design (the update path handles DOM mutations, not shared-element pairing), but the documentation is silent on the expected behavior when only `name` changes on a mounted `<ViewTransition>`. ## Suggested fix The name-change detection in [`beginWork`][name-change-detected] (`current.memoizedProps.name !== pendingProps.name`) could additionally set the `Update` flag or an equivalent signal, so the commit phase treats the VT as updated even without child DOM mutations. A cleaner alternative is to keep the fix local to the mutation-phase commit handler for `ViewTransitionComponent`, adding a name-change check alongside `viewTransitionMutationContext`: ```js } else if ( viewTransitionMutationContext || current.memoizedProps.name !== finishedWork.memoizedProps.name ) { finishedWork.flags |= Update; } ``` This would keep the `Update` flag closer to its apparent current usage (set during mutation phase, consumed in measurement) without changing `beginWork` flag behavior. Additionally, the `share` className may need to be consulted in the update path when a name change is detected, not only in the enter/exit pair path. ## Docs note The `<ViewTransition>` documentation distinguishes `share` (enter/exit pairing) from `update` (DOM mutations / layout effects), but does not clarify what should happen when only the `name` prop changes across already-mounted `<ViewTransition>` boundaries. It's unclear whether mounted name toggling is expected to produce a transition or is intentionally unsupported. [react-commit]: https://github.com/facebook/react/commit/4610359651fa10247159e2050f8ec222cb7faa91 [measure-recursive]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L642-L705 [has-instance-changed]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L676-L681 [cancel-animation]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L1616-L1640 [update-flag-set]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitWork.js#L2634-L2645 [before-mutation-gate]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L489-L513 [after-mutation-gate]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L768-L803 [name-change-detected]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberBeginWork.js#L3617-L3622 [update-mutation-gate]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitWork.js#L2623-L2633 [commit-enter]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L287-L326 [commit-exit]: https://github.com/facebook/react/blob/4610359651fa10247159e2050f8ec222cb7faa91/packages/react-reconciler/src/ReactFiberCommitViewTransitions.js#L409-L451
open
kjanat
2026-03-09T16:59:24
2026-03-25T19:23:14
null
[ "Status: Unconfirmed" ]
null
0
{}
6
false
2026-03-29T04:53:25.149453
facebook
react
26,465
I_kwDOAJy2Ks5hkqp1
false
[DevTools Bug] Cannot add child "1161" to parent "942" because parent node was not found in the Store.
### Website or app chrome on local host ### Repro steps it happen with every component that i mount <img width="1470" alt="Screenshot 2023-03-23 at 1 04 00 PM" src="https://user-images.githubusercontent.com/110327079/227134701-d665feca-3326-401e-b957-007c41318be6.png"> ### How often does this bug happen? Every time ### DevTools package (automated) react-devtools-extensions ### DevTools version (automated) 4.27.2-1a88fbb67 ### Error message (automated) Cannot add child "1161" to parent "942" because parent node was not found in the Store. ### Error call stack (automated) ```text at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:27939:43 at bridge_Bridge.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:25892:22) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26061:14 at listener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:56323:39) ``` ### Error component stack (automated) _No response_ ### GitHub query string (automated) ```text https://api.github.com/search/issues?q=Cannot add child to parent because parent node was not found in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react ```
open
bhanuUdai
2023-03-23T07:36:11
2026-03-25T19:23:09
null
[ "Type: Bug", "Status: Unconfirmed", "Resolution: Needs More Information", "Component: Developer Tools" ]
null
0
{ "+1": 27 }
29
false
2026-03-29T04:53:25.292918
facebook
react
35,982
I_kwDOAJy2Ks7xJp2Z
false
Bug: react-hooks/refs false positive using IntersectionObserver
React version: 17.0.2 eslint-plugin-react: 7.37.5 eslint-plugin-react-hooks: 7.0.1 ## Steps To Reproduce Attempting to create a simple hook to wrap `IntersectionObserver`: ```ts function useIntersectionObserver(options: Partial<IntersectionObserverInit>) { const callbacks = useRef(new Map<string, IntersectionCallback>()); const onIntersect = useCallback((entries: ReadonlyArray<IntersectionObserverEntry>) => { entries.forEach(entry => callbacks.current.get(entry.target.id)?.(entry.isIntersecting)) }, [] ); const observer = useMemo(() => // This line incorrectly reports "Error: Cannot access refs during render" new IntersectionObserver(onIntersect, options), [onIntersect, options] ); // Some other stuff here } ``` Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior The above code reports the following when running `eslint`: ``` error Error: Cannot access refs during render React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the `current` property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef). common\ReactHooks.ts:97:30 | | const observer = useMemo(() => | new IntersectionObserver(onIntersect, options), [onIntersect, options]); | ^^^^^^^^^^^ Cannot access ref value during render | ``` ## The expected behavior The code is not using a ref (at least, not directly) and anyway it isn't rendering - so it's a mystery as to why the error is reported, unless I'm missing some subtle behaviour?
open
ashleymercer
2026-03-09T14:11:07
2026-03-25T19:35:13
null
[ "Status: Unconfirmed" ]
null
0
{ "heart": 1 }
1
false
2026-03-29T04:53:25.333400
facebook
react
29,045
I_kwDOAJy2Ks6IlPZG
false
Bug: eslint-plugin-react-hooks documentation might be misleading
Splits from https://github.com/WordPress/gutenberg/issues/61598 & https://github.com/WordPress/gutenberg/pull/61599 The current explanation about "[additionalHooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks#advanced-configuration)" under `react-hooks/exhaustive-deps` might be misleading. The regex in the example catches more than needed. This: ```json "additionalHooks": "(useMyCustomHook|useMyOtherCustomHook)" ``` Will catch also things like this: ```js function App() { const data1 = useMyCustomHook2(); const data2 = useMyOtherCustomHookTest(); // ... } ``` This might be the reason why Gutenberg used the same approach (which caused the bug mentioned above): https://github.com/WordPress/gutenberg/blob/2df566c771dba22eec2841081a00963a2e56658c/packages/eslint-plugin/configs/react.js#L37-L42
open
StyleShit
2024-05-12T19:16:25
2026-03-25T19:23:07
null
[ "Status: Unconfirmed" ]
null
0
{}
21
false
2026-03-29T04:53:25.383827
facebook
react
35,220
I_kwDOAJy2Ks7akChr
false
Bug: useState hook not updating state correctly in async functions
## Bug Description When using useState hook inside an async function, the state doesn't update correctly after awaiting a promise. ## Steps To Reproduce 1. Create a component with useState 2. Create an async function that awaits a promise 3. Try to update state after the await 4. State shows stale value ## Expected Behavior State should update correctly after async operations ## Actual Behavior State retains old value React version: 19.0.0
closed
not_planned
Arun24-8
2025-11-26T10:27:48
2026-03-25T19:43:02
2026-03-15T07:21:55
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "heart": 1 }
5
false
2026-03-29T04:53:25.520324
facebook
react
35,960
I_kwDOAJy2Ks7wAq-w
false
[Compiler Bug]: React Compiler silently skips custom hooks whose only hook call is use()
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEwBcMCAhnggMIQB2VAHngDQFRgJsc31OEBfAgDMYEDAQDkZcnDySA3AB06KuPTCEAsgE9aDBMwIBeEjKr7+BADxECAN3IAbKAmQFNMNHQDmBIQB8BAAUdFBOTgCEAJTKqnSGOPgiUHRyaPTsnLqWhngA6mh4ABYAqpzB0UQqBCQahMSOLgj+JlkIwTl8ebE1BGR4sHR2Ta7+cQIqKom4hMKp6Zk8XQbMhSXlvKt4ldXDdXSaI85jQqY8ucydet3MvfsDQ8fN4yoCICwg6nTCaD4o6GwswIeB0WBaxAACi4fN4APJYPAZQ6tUTiKQAI3IGIQTgAtFgYd48TI5Hj1Ng0E4EDAAPQAEzQmkUUzowWAfVptIpWCplGRWgg9LcBCUIGcTjFbw8-LAvwQYAI0KgsLoCKRGliH3AxQgAHcAJIGGB0ZxgFDCM0IARAA ### Repro steps 1. Create a context `MyContext` and a custom hook `useMyContext` that only calls `use(MyContext)` 2. Compile in the default infer compilation mode. 3. Observe that `useMyContext` is silently skipped by the compiler, no memoization is applied. 4. Change `use(MyContext)` to `useContext(MyContext)`, the compiler now recognizes the function as containing a hook call and compiles it correctly. ### How often does this bug happen? Every time ### What version of React are you using? 19.2.4 ### What version of React Compiler are you using? babel-plugin-react-compiler 1.0.0
open
carlbergman
2026-03-05T08:30:48
2026-03-25T19:37:15
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:25.566046
facebook
react
32,030
I_kwDOAJy2Ks6lgNYK
false
Bug: React 19 cannot run apps in both dev & production mode simultaneously
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> Unable to run multiple React micro frontends (MFEs) when they don't all use the same `NODE_ENV`. When developing large systems using micro frontends (e.g. via module federation), it is not feasible for developers to have every MFE running locally. Instead, a proxy config can be used to pull built artifacts of existing MFEs and only run relevant apps locally. This worked well in React 18, but does not in React 19. React version: 19 ## Steps To Reproduce 1. Using some MFE solution (in my example, module federation), run a host app in dev mode (NODE_ENV === 'development') and a remote app in prod mode (NODE_ENV === 'production') 2. Note that the runtimes are not compatible. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://github.com/rdenman/react-19-mixed-env-mf <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Unable to run mixed builds (dev + prod) ## The expected behavior Both dev and prod builds should be compatible. This is the error I see when running the attached example. Note that downgrading the example to React 18 fixes this issue, and running both apps in either dev or prod mode also resolves the issue. <img width="705" alt="Screenshot 2025-01-08 at 7 59 06 PM" src="https://github.com/user-attachments/assets/7b66a8b5-8704-4950-a706-2f3501a0e39c" />
open
rdenman
2025-01-09T02:13:36
2026-03-25T19:25:47
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 20, "heart": 2, "hooray": 4 }
31
false
2026-03-29T04:53:25.604643
facebook
react
35,971
I_kwDOAJy2Ks7wa5qJ
false
Bug: React Compiler does not preserve HTML entity
When using React Compiler on this component: ```jsx export default function MyApp() { return ( <div> &#32; <span>hello world</span> </div> ); } ``` the HTML entity gets removed with compiler: ```js import { c as _c } from "react/compiler-runtime"; export default function MyApp() { const $ = _c(1); let t0; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = ( <div> <span>hello world</span> </div> ); $[0] = t0; } else { t0 = $[0]; } return t0; } ``` React version: 19.2.4 ## Steps To Reproduce Link to code example: https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNv3H5F+ADyEmANwB8CpYoBkAYgDMAJgDcO3crCYydTQAsElShHwB3HJULKA9DbttCUU-NS0dQQs6AF9xEAAaEDhWEiYAcxQQJgBbbDx8XE5MBBF8AAVKKDSmOgB5TGZWMHxo-BIYCGz8AHIAIzJe5wBaTErquiGpMkYh5NymSgQYXzUwXG6o8X4xCV9fOcwFska6dghiZHxREDIXa-FWsGOmMFSEZoqqmvqTsEiE8AOCDuACSdFwSzotzAKHIlDACGiQA ## The current behavior HTML entity is removed. ## The expected behavior HTML entity should be kept as-is.
open
mihkeleidast
2026-03-06T11:01:09
2026-03-25T19:37:21
null
[ "Status: Unconfirmed" ]
null
0
{}
8
false
2026-03-29T04:53:25.644746
facebook
react
35,966
I_kwDOAJy2Ks7wP5-o
false
Bug: `startTransition` inside `popstate` shows Suspense fallback instead of previous UI
When `startTransition` is called inside a `popstate` event handler (like pressing the browser back button), React shows the Suspense fallback if the component suspends. Outside of `popstate` events, `startTransition` keeps the previous UI visible while the new content loads. The `popstate` case should behave the same way. This was discussed as planned but not yet implemented in #26025: > "the thinking was we would fall back to the regular transition behavior (give up and change it back to async). This PR doesn't implement that but it's not as urgent as the main fix and we can add that later." React version: 19.2.0 ## Steps To Reproduce 1. Render a component that suspends inside a `Suspense` boundary. Let it resolve. 2. Call `history.pushState` and use `startTransition` to render a different component. 3. Invalidate the first component's data so it will suspend again on next render. 4. Press the browser back button. In the `popstate` handler, call `startTransition` to switch back. Link to code example: https://codesandbox.io/p/sandbox/mfs2q3 Note: Does not reproduce in CodeSandbox's iframe. Open the preview in a new tab. ## The current behavior The Suspense fallback is shown during back navigation, even though the update is wrapped in `startTransition`. This only happens when `startTransition` is called inside a `popstate` event. The same `startTransition` call outside of `popstate` keeps the previous UI visible as expected. ## The expected behavior The previous UI should stay visible while the suspended component loads, regardless of whether `startTransition` was called inside a `popstate` event or not. The synchronous popstate optimization (#26025) should fall back to normal transition behavior when it can't finish without suspending.
open
danteissaias
2026-03-05T21:24:01
2026-03-25T19:43:46
null
[ "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:25.685735
facebook
react
35,758
I_kwDOAJy2Ks7pyRYN
false
Bug: eslint-plugin-react-hooks does not support ESLint 10 in peerDependencies
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19.x ## Steps To Reproduce 1. Create a React project with `eslint-plugin-react-hooks@7.0.1` 2. Upgrade ESLint to version 10.0.0 3. Run `npm install` <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: ```json { "devDependencies": { "eslint": "^10.0.0", "eslint-plugin-react-hooks": "^7.0.1" } } ``` <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior npm error ERESOLVE could not resolve npm error Could not resolve dependency: npm error peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" from eslint-plugin-react-hooks@7.0.1 ## The expected behavior "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0"
open
rstar327
2026-02-10T15:59:56
2026-03-25T19:23:04
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 89 }
14
false
2026-03-29T04:53:25.730400
facebook
react
33,635
I_kwDOAJy2Ks69N4op
false
Bug: Hydration issue involving __gchrome_uniqueid on iPad Chrome/Edge browser
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> Recreating this issue from https://github.com/vercel/next.js/issues/77710 as Next team [mentioned this relates more to React's hydration behavior](https://github.com/vercel/next.js/issues/77710#issuecomment-3001866930). React version: 19.1.0 iPad Chrome: 135.0.7049.53 iPad Edge: 134.3124.95 iPad Safari tested without issues. ## Steps To Reproduce See reproduction 1. Start development server 2. Visit development server via iPad Chrome/Edge browser app. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://github.com/danvim/next-gchrome-hydration-reproduction <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior > Hydration failed because the server rendered HTML didn't match the client... ```diff <Home> <input - __gchrome_uniqueid="1" > ... ``` ## The expected behavior Expected no error.
open
danvim
2025-06-25T07:26:12
2026-03-25T19:51:06
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 10, "eyes": 1 }
8
false
2026-03-29T04:53:25.765473
facebook
react
36,002
I_kwDOAJy2Ks7xtHKI
false
Bug: why not Signal
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1.why not Signal 2.why not Signal <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: why not Signal <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior why not Signal ## The expected behavior why not Signal
closed
completed
LiMao00
2026-03-11T01:34:12
2026-03-26T05:47:38
2026-03-11T04:55:32
[ "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:25.810577
facebook
react
21,057
MDU6SXNzdWU4Mzg1OTQ2MzA=
false
Bug: useState with class as initial state throws an error
Using a JavaScript class as initial state in `useState` throws an error. This is because `mountState` check if the initial state is a function by `typeof initialState === 'function'` and classes are technically functions. However since ES6+, I feel like most developers don't consider classes functions because of the less prototype-inheritance feel since ES6 and the `class` keyword. React version: 17.0.2 ## Steps To Reproduce 1. Define an ES6 class 2. Use the class as `initialState` argument to `useState` Code example: ```jsx import { useState } from "react"; import ReactDOM from "react-dom"; class A {} function App() { const [cls, setCls] = useState(A); return <h2>{cls.name}</h2>; } ReactDOM.render(<App />, document.body); ``` ## The current behavior ``` TypeError: Cannot call a class as a function at _classCallCheck (eval at z (eval.js:42), <anonymous>:3:11) at A (VM302 index.js:19) at mountState (react-dom.development.js:10436) at Object.useState (react-dom.development.js:10919) at useState (react.development.js:954) at App (VM302 index.js:25) ``` Alternatively, the error can be `TypeError: Class constructor X cannot be invoked without 'new'`. ## The expected behavior As mentioned in the description above, I would - either expect classes to work - or mention this caveat in the docs. I guess checking, if the initial state is actually a non-class function, could cause instances of subclasses of functions not to work (depending how the check is done).
open
jneuendorf
2021-03-23T10:51:17
2026-03-25T19:53:00
null
[ "Status: Unconfirmed", "Type: Discussion" ]
null
0
{}
8
false
2026-03-29T04:53:25.849130
facebook
react
35,397
I_kwDOAJy2Ks7fiFar
false
Bug: Nested providers for the same context will lead to unnecessary render calls when only the outside context value changed (React 19 only)
Since React 19, nested providers for the same context will lead to unnecessary render calls for some scenarios. I wrote a unit test and confirmed that React 18.3.1 behaves as expected. E.g. for the following pseudo-code React component structure: ```tsx <SomeContextProvider> <SomeContextConsumer> <SomeContextProvider> <SomeContextConsumer /> </SomeContextProvider> </SomeContextConsumer> </SomeContextProvider> ``` If the value provided by the outer SomeContextProvider changes, the innermost SomeContextConsumer will also be rendered. (Actually it will only "semi-render", because even though the function is called, the result is ignored.) It is probably only an unnecessary detail for most users, but for me it broke some tests which track every single render for performance reasons and it actually causes >1k unnecessary component function calls in some situations because I utilize some nested contexts for some widely used information where it is important that elements are only rerendered when the context value changes. So if the top-level context provider is updated, but another provider between the element and it is not updated, the element should not be rendered. Also, it is very concerning that it executes the component function but ignores the result. React version: 19.2.3 (and 19.0.0) Works in 18.3.1 ## Steps To Reproduce 1. Open code example below. Execute `vitest` in terminal. - The test will fail, because the component was kind of rendered, even though it was unnecessary. 2. Downgrade to React 18.3.1 by updating package.json and running `npm install` 3. Execute `vitest` in terminal. The test will pass. Link to code example: [Repro code in unit test on Stackblitz](https://stackblitz.com/edit/vitest-tests-browser-examples-akwsn1xm?file=tests%2Freact19ContextsBugMinimalReprodWithUnitTest.test.tsx) ## The current behavior The inner component consuming the React context is called, even though the context value has not changed for it. ## The expected behavior Like in React 18.3.1: Only component functions where the context value has changed will be called.
open
thomasjahoda
2025-12-20T17:36:35
2026-03-26T05:48:02
null
[ "Status: Unconfirmed" ]
null
0
{}
2
false
2026-03-29T04:53:25.898180
facebook
react
36,146
I_kwDOAJy2Ks721Nj_
false
Bug:
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
closed
completed
raffryn22
2026-03-26T06:44:13
2026-03-26T10:03:03
2026-03-26T06:44:37
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:25.934862
facebook
react
36,145
I_kwDOAJy2Ks72z2ud
false
[Feature Request]: Add fetch and Server-Sent Events supports
## Purpose Fetch data from back-end services is the most often used scenarios in an app (especially in a web app). Add `useFetchJSON` and `useFetchSSE` hook APIs to add supports for HTTP fetch and server-sent event (a.k.a SSE). The arguments of these should looks similar `fetch` API. ```ts export function useFetchJSON<T = any>(input: RequestInfo | URL, init?: RequestInit, dependencies: DependencyList): { value: T; loading: boolean; error: any; }; export function useFetchSSE(input: RequestInfo | URL, init?: RequestInit, dependencies: DependencyList): { list: ServerSentEventItem[]; loading: boolean; error: any; length: number; last: ServerSentEventItem; }; ``` The `fetch` action occurs only once even if the component updates but reserve a dependency list to allow developers have the right of control. ## Usages The way to fetch in React is like call `fetch` API but it returns an object with following properties: - `value`: The result parsed in JSON; or `undefined` during sending the request and receiving the response. - `loading`: A value indicating whether it is in progress. - `error`: The error information if fails. ```tsx import { useFetchJSON } from 'react'; interface IUserInfo { name: string; age: number; } const fetchOptions = { method: "GET", mode: "cors", credentials: "include", headers: { "Accept": "application/json" } }; function Something() { const { value, loading } = useFetchJSON<IUserInfo>(API_URL, fetchOptions, []); return loading ? ( <div> <span>Loading…</span> </div> ) : ( <div> <span>Name: </span><span>{value.name}</span> <br /> <span>Age: </span><span>{value.age.toString(10)}</span> </div> ); } ``` The `useFetchSSE` hook API is used to expect what the API returns in SSE content type (streaming), e.g. LLM chat API. It returns an object with following properties. - `list`: An array of the result which has alread returned. - `loading`: A value indicating whether the fetch is in progress (including output is still streaming). - `error`: The error information if fails. - `length`: The count of the SSE items already returned. It equals to `list.length`. - `last`: The last SSE item already returned; or `undefined` if none during accessing. It equals to `list[list.length - 1]`. ```tsx import { useFetchSSE } from 'react'; const fetchOptions: RequestInit = { method: "POST", mode: "cors", credentials: "include", headers: { "Content-Type": "application/json", "Accept": "text/event-stream, application/json" } }; export function StreamingItems() { fetchOptions.body = JSON.stringify(REQ_BODY); const { list } = useFetchSse(SSE_API_URL, fetchOptions, []); return ( <ul> {list.map((e, i) => { return e.event === "message" ? <li key={`item-${i}`}>{e.data}</li> : null; })} </ul> ) } ``` ## Implementation ```tsx import { useEffect, useState } from "react"; export function useFetchJSON<T>(input: RequestInfo | URL, init?: RequestInit, dependencies?: DependencyList) { const [value, setValue] = useState<T>(); const [loading, setLoading] = useState(true); const [error, setError] = useState(); useEffect(() => { fetch(input, init).then((response) => { return response.json().then(r => { setLoading(false); setValue(r); return r as T; }); }).catch((err: any) => { setError(err); setLoading(false); }); }, dependencies === undefined ? [input, init] : dependencies); return { value, loading, error, }; } export function useFetchSSE(input: RequestInfo | URL, init?: RequestInit, dependencies?: DependencyList) { const [list, setList] = useState<ServerSentEventItem[]>([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(); useEffect(() => { fetch(input, init).then((response) => { return handleSse(response, new TextDecoder("utf-8"), item => { setList([...list, item]); }).then(arr => { setLoading(false); return arr; }); }).catch((err: any) => { setError(err); setLoading(false); }); }, dependencies === undefined ? [input, init] : dependencies); return { list, loading, error, length: list.length, last: list.length > 0 ? list[list.length - 1] : undefined, }; } ``` > https://kingcean.org/blog/?2025/sse The function `handleSse` in `useFetchSSE` above is the implementation (as following) to convert the HTTP response to SSE items. ```ts async function handleSse(response: Response, decoder: TextDecoder, callback: ((item: ServerSentEventItem) => void)) { if (!resp.body) return Promise.reject("no response body"); const reader = resp.body.getReader(); let buffer = ""; const arr: ServerSentEventItem[] = []; while (true) { const { done, value } = await reader.read(); if (done) { convertSse(buffer, arr, callback); return arr; } buffer += decoder.decode(value, { stream: true }); const messages = buffer.split("\n\n"); if (messages.length < 2) continue; buffer = messages.pop() || ""; messages.forEach(msg => { convertSse(msg, arr, callback); }); } } function convertSse(msg: string, arr: ServerSentEventItem[], callback: ((item: ServerSentEventItem) => void)) { if (!msg) return; const sse = new ServerSentEventItem(msg); arr.push(sse); callback(sse); return sse; } ``` The model `ServerSentEventItem` mentioned above is following. ```ts export class ServerSentEventItem { private source: Record<string, string>; private dataParsedInJson: Record<string, unknown> | undefined; constructor(source: string) { this.source = {}; (source || "").split("\n").forEach(line => { const pos = line.indexOf(":"); if (pos < 0) return; const key = line.substring(0, pos); const value = line.substring(pos + 1); if (!this.source[key] || (key !== "data" && key !== "")) this.source[key] = value; else this.source[key] += value; }); } get event() { return this.source.event || "message"; } get data() { return this.source.data; } get id() { return this.source.id; } get comment() { return this.source[""]; } get retry() { return this.source.retry ? parseInt(this.source.retry, 10) : undefined; } dataJson<T = Record<string, unknown>>() { const data = this.source.data; if (!data) return undefined; if (!this.dataParsedInJson) this.dataParsedInJson = JSON.parse(data); return this.dataParsedInJson as T; } get(key: string) { return this.source[key]; } } ```
open
kingcean
2026-03-26T05:33:43
2026-03-26T10:03:39
null
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:26.089161
facebook
react
32,478
I_kwDOAJy2Ks6rxEa1
false
Bug: Support command event
`command` and `commandfor` [attributes](https://html.spec.whatwg.org/#attr-button-commandfor) were recently added to the HTML spec, along with a new [`command` event](https://open-ui.org/components/invokers.explainer/#custom-behaviour). This is supported in Chrome/Edge since [version 135](https://developer.chrome.com/release-notes/135?hl=en#invoker_commands_the_command_and_commandfor_attributes), [Firefox 144](https://www.firefox.com/en-US/firefox/144.0beta/releasenotes/) and [Safari 26.2](https://developer.apple.com/documentation/safari-release-notes/safari-26_2-release-notes). See MDN for a list of the valid commands - the `command` event should fire for all these commands. React version: 19 ## Steps To Reproduce 1. Include the following markup ```jsx <button command="toggle-popover" commandfor="popover">Toggle popover</button> <div onCommand={handleCommand} popover="auto" id="popover">popover content</div> ``` 2. Define the handleCommand function ```jsx function handleCommand(event) { console.log(`a command happened: ${event.command}`); } ``` 3. Open in Chrome or Edge and look at the browser dev tools console. Link to code example: https://codesandbox.io/p/sandbox/distracted-lucy-vlh25y ## The current behavior Errors with the message: "Unknown event handler property `onCommand`. It will be ignored." ## The expected behavior The `command` event triggers the event handler.
open
o-t-w
2025-02-26T14:15:13
2026-03-25T19:53:16
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 8, "eyes": 1 }
7
false
2026-03-29T04:53:26.180448
facebook
react
34,053
I_kwDOAJy2Ks7DQP4o
false
Bug: Java object is gone Instagram/ Facebook Webview
In Instagram/Facebook in-app browser (WebView), our React web app crashes with error: "Uncaught Error: Java object is gone" This happens when user loads the page after some seconds the error happen. The error does not occur in Chrome/Safari. We traced the crash to `navigationPerformanceLoggerJavascriptInterface.postMessage` Tested on latest versions of Facebook & Instagram on Android. Expected: App should not crash on call. Actual: WebView terminates interaction or throws fatal error.
closed
completed
harshitm1234
2025-07-30T06:21:55
2026-03-26T14:49:09
2026-02-15T03:53:44
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "+1": 4 }
6
false
2026-03-29T04:53:26.330692
facebook
react
36,124
I_kwDOAJy2Ks71Iejw
false
[DevTools Bug] Commit tree already contains fiber "288". This is a bug in React DevTools.
### Website or app Private repo (project on Tanstack Start) ### Repro steps 1- I was on a page and clicked a link that took me to CreatLoanForm 2 - There's a lot of bars shown on the profiler i picked one of the hightest ones 3 - The error was thrown This is the code: import { CurrencyInput, DataModuleFormProps, DateInput, Form, FormContainer, FormGroup, FormMasterDetailLayout, FormRow, FormWatch, NumericInput, PaymentFrequencySelect, PercentageInput, RichTextEditor, Tab, TabPanel, Tabs, TabsList, } from '@/components' import { useLoanForm } from '../hooks/useLoanForm' import { LoanOfficerSearchInput, ProfileSearchInput } from '@/features/profiles' import LoanProjectionCard from './loan-projection-card' import { Loan } from '../models/loan' import { LoanFormValues } from '../lib/schemas/loanFormSchema' import LoanAmortizationPreview from './loan-amortization-preview' import { Project } from '@/features/projects' interface CreateLoanFormProps extends DataModuleFormProps< Loan, LoanFormValues > { project: Project } const CreateLoanForm = (props: CreateLoanFormProps) => { const form = useLoanForm(props) console.log('will i rerender because of subscribtions?') return ( <FormContainer form={form}> <Tabs> <TabsList> <Tab index={0}>Datos</Tab> <Tab index={1}>Amortización</Tab> </TabsList> <TabPanel index={0}> </TabPanel> <TabPanel index={1} unmountOnExit> </TabPanel> </Tabs> </FormContainer> ) } export default CreateLoanForm ### How often does this bug happen? Every time ### DevTools package (automated) react-devtools-extensions ### DevTools version (automated) 7.0.1-3cde211b0c ### Error message (automated) Commit tree already contains fiber "288". This is a bug in React DevTools. ### Error call stack (automated) ```text at updateTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:699600) at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:698832) at $e.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:703384) at CommitRankedAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1008643) at renderWithHooks (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:66940) at updateFunctionComponent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:97513) at beginWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:111594) at performUnitOfWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184246) at workLoopSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184102) at renderRootSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:183886) ``` ### Error component stack (automated) ```text at CommitRankedAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1008444) at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:879909) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1144384 at ao (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:898411) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901313 at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at SuspenseTreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1147064) at InspectedElementContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:915935) at TimelineContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:994422) at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:986233) at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:786019) at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:815755) at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:972480) at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1175879) ``` ### GitHub query string (automated) ```text https://api.github.com/search/issues?q=Commit tree already contains fiber . This is a bug in React DevTools. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react ```
open
JorgelRight34
2026-03-21T14:03:04
2026-03-27T14:21:30
null
[ "Type: Bug", "Status: Unconfirmed", "Component: Developer Tools" ]
null
0
{ "+1": 1 }
1
false
2026-03-29T04:53:26.607071
facebook
react
36,143
I_kwDOAJy2Ks72txyz
false
Performance: RSC rendering pipeline performance analysis
React version: `19.3.0-canary-c0d218f0-20260324` and uhh, [a custom fork](https://github.com/switz/react/pull/2) ## Steps To Reproduce 1. first set of benchmarks are in this repo: https://github.com/switz/rsc-benchmarks 2. second set are based on my fork implementing a fused rsc pipeline renderer (one pass, fizz takes on more responsibility - [preview here](https://github.com/switz/react/pull/2)) <!-- Link to code example: --> ## Some Background I am working on a new RSC-based framework. There's been a lot of recent discussion around react-based frameworks' performance in what are generally not representative of real world performance (aren't all web benchmarks?), but they did uncover some serious gaps. RSC performance is honestly _sufficient_ for most use-cases, but it could be much more efficient and gets very throttled very quickly. I spent a lot of time digging into RSC rendering throughput today+yesterday with claude. Both in next and outside of next (w/ my new framework, some pure react, etc.). I found two small perf wins in both Fizz and Flight ([sent a PR for Fizz](https://github.com/facebook/react/pull/36139)), but they are minimal in comparison to the two below. I spent most of the day debugging real world scenarios: code running on the same k8s cluster across the same apps in different contexts (next, my framework, etc.) all running through real-world networks. I then dropped down to baseline benchmarks to try and isolate the problems which reflected my real-world testing. This is all based on single core, single threaded rendering. If I got anything wrong here, if I shoved my foot in my mouth, if I over-dramatized the situation, please tell me. I'm not an expert in web throughput engineering, cpu architectures, or javascript/react internals. I'm just a long-time software engineer who's having way too much fun building my own framework on what I consider to be the most complete web architecture. ## The current behavior These benchmarks are run in as simple cases as I could define, on my own M1 Max, on a single core at a time. To isolate the performance, I ran each test in a container to ensure somewhat consistent results where we could control the CPU limits (is this bad? you tell me – I'm sure there's some issue with it). On the average web server, perf will be worse than here which only exacerbates the issue further. None of this is meant to be a perfect or clean room benchmark – but, I think you'll find fairly consistent results as I did. It's important to note that cpu-bound tasks just suffer in javascript environments. This isn't an I/O issue. You'll see below how the current RSC infrastructure compounds the CPU problem. ### Node Streams vs Web Streams The first issue is fairly well documented and offers the first ceiling of performance. Next runs on web streams (`renderToReadableStream`) which are written in javascript and much slower than node streams. If you write a barebones RSC rendering test, you'll see that this is the first limit you hit. | Metric | Node Streams | Web Streams | Difference | |----------------|--------------|-------------|-----------------| | req/s | 1,004 | 743 | Node 35% faster | | Median latency | 43ms | 58ms | Node 26% faster | | P99 latency | 134ms | 139ms | ~same | You get a 35% win in this particular case - without this you'll eventually throttle, so for anyone deploying to node environments, this should be the first priority. But this only really is the first win, and it is negated in most real world scenarios because it brings us to the second major issue. | Test | req/s | Median | Size | What it measures | | --- | --- | --- | --- | --- | | [0] renderToString | 376 | 2.4ms | 116KB | Sync SSR baseline — no streams | | [0a] Direct SSR (Node pipe) | 273 | 3.6ms | 116KB | Streaming SSR, no RSC | | [0b] Direct SSR (Web stream) | 197 | 4.5ms | 116KB | Streaming SSR, Web streams | | [1a] Flight serialize | 110 | 7.6ms | 235KB | RSC → Flight wire format | | [1b] SSR from Flight (Node) | 100 | 6.8ms | 116KB | Pre-rendered Flight → HTML | | [1c] SSR from Flight (Web) | 92 | 7.7ms | 116KB | Same, Web streams | | [2a] Full RSC → Node | 44 | 22.7ms | 398KB | Flight + SSR + inject | | [2b] Full RSC → Web | 36 | 25.6ms | 398KB | Same, Web streams | | [3a] Full RSC → Node + gzip | 40 | 25.0ms | 22KB | Full pipeline + gzip | | [3b] Full RSC → Web + gzip | 34 | 27.3ms | 22KB | Same, Web + gzip | These results align with what we should expect: * The full RSC pipeline is close to 10x worse than renderToString * Node Streams are 20-30% faster than web streams, but in RSC that only buys us a small amount of improved throughput * the tee coupling (flight + ssr) fights each other on the event loop and cuts half the performance right there * raw SSR (not RSC) gets decent performance at 273 req/s * tests 2+3 have **no client components**. the increased payload + cost is just from serializing the flight response * reducing the flight payload for server-only trees (or otherwise) would be a huge net benefit here * I would expect with client components and a serialized boundary, this would get even worse Now measuring req/s with 1 concurrent request isn't the best way to test real world performance. But what you'll find if you dig in is that with more concurrency, CPU usage throttles even harder, and memory usage balloons. So I think it's enough to show the drop-off. So that brings us to.. ### Flight Serialization + SSR + Compression When preparing an initial HTML response, React kicks off a flight serialization of the server component tree. This is because Fizz doesn't have knowledge of the server-client boundary. After this serialization, the output gets tee'd into two streams for frameworks to consume: - the flight serialization is converted to a fizz stream, which turns it back into a react tree, then the react tree is ssr'd/serialized to html - the framework generates flight-based hydration <script> tags for injecting On a single thread, these parallel streams back-pressure and compete for cpu. By serializing to flight, then back to fizz, then to html we end up throttling the single thread with a ton of unnecessary work. So what's the solve? I mean, that's up to you guys. But on a single-thread, there's only one real pathway to improved performance: do less work. So rather than the three-step intermediate serialization and deserialization, it would be better if there was a "fused" pipeline to handle rsc -> ssr in one pass. This would require some architectural changes to Fizz to identify client components and serialize the prop boundaries. My guess is that Fizz and Flight were given separate responsibilities because in theory you may want to run them in different places. But in practice, those of us shipping RSC servers run them together anyway. I built a proof of concept with Claude (it's not wholly complete, perhaps the benchmarks are misleading, the props serialization is clearly incomplete, but it's a worthy exploration) and saw some real gains in performance, memory, and more consistent throughput under concurrent load. Especially for the pure server-component path (sans client components). ### Per-Request Breakdown (226-product PLP) | Phase | Full RSC Pipeline | Fused Renderer | | --- | --- | --- | | Flight tree walk + encoding | 2.36ms | — | | Props serialization (JSON) | 0.88ms | 0.88ms | | Flight deserialize | 0.32ms | — | | Fizz render | 3.53ms | 1.47ms ¹ | | Hydration data to client | 0.65ms | 0.20ms | | Fused boundary overhead | — | 1.73ms ² | | **TOTAL** | **7.74ms** | **4.28ms** | ¹ Fused Fizz render matches plain `renderToPipeableStream` (1.42ms) — no Flight element overhead ² Markers, module resolution, props serialization, chunk output for hydration data Our fused pipeline starts performing closer to raw SSR when there are no client components. But we do see a large drop-off once we serialize props into client components. ### Throughput Comparison | Mode | ms/req | req/s | Output | Description | | --- | --- | --- | --- | --- | | Plain Fizz (no RSC) | 1.42ms | 702 | 102 KB | Theoretical ceiling | | Fused (server-only) | 1.47ms | 680 | 102 KB | Matches plain Fizz | | **Fused (w/ client boundaries)** | **4.28ms** | **234** | **433 KB** | **1.8x faster than full pipeline** | | Full RSC pipeline + hydration | 7.74ms | 129 | 411 KB | Current | ### Where the 1.8x Comes From | Eliminated | Saved | | --- | --- | | Flight tree walk + wire format encoding | 2.36ms | | Flight wire format parsing | 0.32ms | | Flight element reconstruction overhead in Fizz | 2.11ms | | Flight payload inlining (`JSON.stringify`) | 0.45ms | | **Total eliminated** | **5.24ms** | | Added | Cost | | --- | --- | | Props serialization at boundaries | 0.88ms | | Hydration script emission | 0.20ms | | Boundary markers + module resolution + queue management | 0.65ms | | **Total added** | **1.73ms** | This results in roughly 1.8x fewer CPU time than the current path. It's possible this is not a great benchmark, but it's just intended to be a proof of concept. ### Key Properties | Property | Full Pipeline | Fused | | --- | --- | --- | | Tree walks | 3 (Flight + Flight Client + Fizz) | 1 (Fizz only) | | Serialization passes | 2 (Flight wire + inline payload) | 1 (props at boundaries) | | Intermediate buffers | ~291 KB Flight wire format | None | | Output to client | ~411 KB (HTML + hydration data) | ~433 KB (HTML + hydration data) | | Peak heap (c=50) | 297 MB | 60 MB | | Flight server modified | — | No (zero changes) | | Reconciler modified | — | No (zero changes) | Client components still suffer from expensive props serialization into hydration tags. But at the very least, memory usage goes way down and throughput becomes more consistent. Because the ergonomics of serializing data from server to client is so clean, it becomes very easy to highten this issue without the end-user understanding why. I know there's been some past discussion of handling the duplication of hydration content. This duplication of data was kind of undersold as not a big deal because of compression, but it turns out the throughput of running that compression inline on the bigger set of data leads to more cpu contention. You can offload compression to an external host (e.g. Cloudflare) or server, but then you're paying the transfer cost and relying on external processing power. ## Why haven't these issues surfaced earlier? Well, I don't know. At the end of the day, a full SSR rendering pipeline will almost always be more delayed by I/O (database, api requests, etc.) than by ~10-20ms of cpu time. The concurrency issue is fairly easily papered over with a few extra pods or cores. People get fewer req/s than they think. On top of which, the most observed places that RSCs have been deployed has been on serverless platforms, where each request often gets its own thread – so you wouldn't notice the concurrency isuses unless you're looking at a traditional node server or really digging in. The problem here isn't really the wall clock of the cpu time (imo), it's the bottlenecking and throughput - JS just plain suffers here. So this is all easy to miss, or perhaps makes it worth dismissing as unnecessary optimization entirely. But I think we'd all agree that higher throughput, better concurrency, lower memory, fewer bytes would be a net win if possible. And might bring RSC performance back to more traditional alternatives, while maintaining its architectural advantages. After doing some research, I found an [issue](https://github.com/facebook/react/issues/34727) opened by @WIVSW from October that essentially identified much of this. They also saw a 10x drop in req/s when switching to the RSC pipeline. ## The expected behavior Ultimately, the desire is that RSCs render faster and more concurrently across a variety of scenarios: pure server rendering, many client boundaries/props serialization, and so on. With a reduction in memory usage and thrashing. Hope this is useful, I spent some time trying to understand the internals of React so if I got anything wrong, please reorient me in the right direction – thanks for reading.
open
switz
2026-03-25T23:14:04
2026-03-27T19:10:29
null
[ "Status: Unconfirmed" ]
null
0
{ "eyes": 3, "heart": 4 }
0
false
2026-03-29T04:53:26.655868
facebook
react
17,355
MDU6SXNzdWU1MjIzMzY1MzY=
false
"Should not already be working" in Firefox after a breakpoint/alert
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** I'm seeing "Error: Should not already be working" after upgrading to React 16.11 **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** This is exclusively happening on an older version of Chrome, 68.0.3440 on Windows 7 I was unable to reproduce this in a VM environment but our Sentry is getting littered with these errors. I know it's a long shot, but I wasn't able to find any information about this error anywhere, just a reference in the error codes file in react, so thought it would be a good idea to report this just in case. Curious if anyone has seen this.
open
gzzo
2019-11-13T16:35:19
2026-03-26T19:05:46
null
[ "Type: Bug", "Difficulty: medium", "Type: Needs Investigation", "good first issue" ]
null
0
{ "+1": 80, "heart": 1, "hooray": 1, "laugh": 3 }
128
false
2026-03-29T04:53:26.685008
facebook
react
32,580
I_kwDOAJy2Ks6tt_ah
false
[Compiler Bug]: `enableFunctionOutlining` breaks `react-native-reanimated` API callbacks
### What kind of issue is this? - [ ] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [x] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhHCA7MAXABAFQRwGEIBbAB0wQzwF5cAKYXDKMgIwRlwF8BKXHQB8uYAB0MuXOix4A1ggCe+CAEkMAEwQAPIbihgEAEW4BLAG4JNANQCGAGygJGjQSMnTpAbQCMAGlwAJkCAZgBdADoyOwpXd1E2Bwd+T1x+AG5JNJgEbFgpJIcsjF4SkF4gA ### Repro steps Current version the Compiler started to transform `react-native-reanimated` API callbacks too much, breaking the code. I compared it with an older version `babel-plugin-react-compiler@19.0.0-beta-9ee70a1-20241017` and the problem didn't happen there. It seems to be due to the `enableFunctionOutlining` feature. Given the code: ```jsx const TestComponent = ({ number }) => { const keyToIndex = useDerivedValue(() => [1, 2, 3].map(() => null) ); return null; }; ``` Compiler changes it to ```jsx const TestComponent = (t0) => { useDerivedValue(_temp2); return null; }; function _temp() { return null; } function _temp2() { return [1, 2, 3].map(_temp); } ``` Note that `_temp` and `_temp2` are extracted outside. It's ok to extract `_temp2`, the callback of `useDerivedValue`, it's handled on our side as a part of the support for the Compiler. It's not ok to extract `_temp`. The problem lies in the fact that we can (and we do) deduce that `_temp2` must be a worklet, but we cannot **in general** infer if `_temp` should be a worklet. This leads to `_temp` not being workletized and causing a runtime error. We also can't workletize it regardless, in some flows it actually shouldn't be a worklet. To fix it we need to keep all functions defined in a worklet to stay in this worklet. ### How often does this bug happen? Every time ### What version of React are you using? 19 ### What version of React Compiler are you using? 19.0.0-beta-bafa41b-20250307
open
tjzel
2025-03-12T16:24:10
2026-03-27T19:01:15
null
[ "Type: Bug", "Status: Unconfirmed", "Component: React Compiler" ]
null
0
{}
24
false
2026-03-29T04:53:26.773842
facebook
react
31,569
I_kwDOAJy2Ks6e7pDW
false
[Compiler Bug]: False positive local mutation warning inside filter
### What kind of issue is this? - [ ] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [x] eslint-plugin-react-compiler (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEASggIZyEBmMEGBA5DGRfQDoB2HCAHjvgZSjsKaCOwIBhWjnYJ2eABTA0eBBjABfAJQFgHAgThiwhE1EqUCAXmLM8AOihgEAWTUQFCnVYB8u-QYEADYIhGhgUhBB1gKkQc4BBkbsJgSQGAgAkqrqMSpqYImB9pRoQaowCnCkTgjWfnrigc1ollU1ziUQEDqNzf0E4ZHRNngwUAhFzRpTgUx4sOJjE7PaHEWtBArpWTlg9iHsAOZ4ABYEfgAMvbPzi7o72QUANIMR3UEzTQZfP68A2vl1ABdLQBO4wcQAHgAJmgAG4EAD0Pg4XxAGiAA ### Repro steps ```js import React from 'react' export function Component({items}) { const stuff = React.useMemo(() => { let isCool = false const someItems = items .filter(cause => { if (cause.foo) { isCool = true } return true }) if (someItems.length > 0) { return {someItems, isCool} } }, [items]) return <div /> } ``` Getting: ``` InvalidReact: Reassigning a variable after render has completed can cause inconsistent behavior on subsequent renders. Consider using state instead. Variable `isCool` cannot be reassigned after render (9:9) ``` But it's not used after render. Curiously, changing the `if` condition to something that doesn't refer to `someItems` helps. ### How often does this bug happen? Every time ### What version of React are you using? 18.2.0 ### What version of React Compiler are you using? 19.0.0-beta-a7bf2bd-20241110
open
gaearon
2024-11-17T20:15:49
2026-03-27T12:36:11
null
[ "Type: Bug", "Component: React Compiler" ]
null
0
{ "+1": 7, "heart": 4 }
9
false
2026-03-29T04:53:26.821494
facebook
react
11,387
MDU6SXNzdWUyNjkxNDg4MjQ=
false
createPortal: support option to stop propagation of events in React tree
**Do you want to request a *feature* or report a *bug*?** Feature, but also a bug cause new API breaks old `unstable_rendersubtreeintocontainer` **What is the current behavior?** We cannot stop all events propagation from portal to its React tree ancestors. Our layers mechanism with modals/popovers completely broken. For example, we have a dropdown button. When we click on it, click opens popover. We also want to close this popover when clicking on same button. With createPortal, click inside popover fires click on button, and it's closing. We can use stopPropagation in this simple case. But we have tons of such cases, and we need use stopPropagation for all of them. Also, we cannot stop all events. **What is the expected behavior?** createPortal should have an option to stop synthetic events propagation through React tree without manually stopping every event. What do you think?
open
kib357
2017-10-27T15:36:49
2026-03-26T21:43:17
null
[ "Type: Feature Request", "Component: DOM" ]
null
0
{ "+1": 228 }
129
false
2026-03-29T04:53:26.854957
facebook
react
35,187
I_kwDOAJy2Ks7ZnB_w
false
Bug: `useEffectEvent` retain the first render value when is used inside a component wrapped in `memo()`
`useEffectEvent` retains the first render value when it's used inside a component wrapped in `memo()` React version: 19.2.0 ## Steps To Reproduce Minimal repro: ```js import { useState, useEffectEvent, useEffect, memo } from "react"; function App() { const [counter, setCounter] = useState(0); const hello = useEffectEvent(() => { console.log(counter); }); useEffect(() => { const id = setInterval(() => { hello(); }, 1000); return () => clearInterval(id); }, []); return ( <div> <button onClick={() => setCounter(counter + 1)}>{counter}</button> </div> ); } export default memo(App); ``` <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/p/sandbox/gj356q <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior If you click the button and increment the counter you always see `0` in the log. By removing the `memo` you will see the current counter value. ## The expected behavior See the latest counter value even if the component is wrapped in `memo`, since the documentation https://react.dev/reference/react/useEffectEvent does not describe any different behavior if component is wrapped in `memo`.
open
gffuma
2025-11-21T09:26:25
2026-03-28T15:44:04
null
[ "Status: Unconfirmed" ]
null
0
{ "heart": 3 }
5
false
2026-03-29T04:53:26.906523
facebook
react
36,128
I_kwDOAJy2Ks71iSsR
false
[Compiler Bug]: React Compiler bug: closure is lost in `useEffect` when component is returned from a factory (causes `ReferenceError: <identifier> is not defined`)
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://github.com/budarin/react-compiler-bug-repro ### Repro steps 1. Create a Vite React TS project with React Compiler enabled. 2. Use a factory function that returns a component and captures injected dependencies (e.g. `showWelcomeNotification`) in a closure. 3. Inside the returned component, call the injected dependency in a `useEffect`. 4. Run the dev server; a runtime `ReferenceError` occurs. ### How often does this bug happen? Every time ### What version of React are you using? 19.2.4 ### What version of React Compiler are you using? 1.0.0
open
budarin
2026-03-23T09:12:36
2026-03-28T12:31:23
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{ "+1": 1 }
14
false
2026-03-29T04:53:26.992670
facebook
react
32,571
I_kwDOAJy2Ks6tgwVx
false
eslint-plugin-react-compiler follow ups
Follow up TODOs: - [ ] Move eslint-plugin-react-hooks into /compiler - [ ] Remove babel.config-react-compiler.js and custom transform in scripts/jest/config.base.js - [ ] Undo hacks in scripts/rollup/build.js - [ ] Remove eslint-plugin-react-hooks from scripts/rollup/bundles.js - [ ] Update Meta sync to import eslint-plugin-react-hooks from compiler sync instead - [ ] Remove scripts/react-compiler and fix root package.json to not need to install and link compiler - [ ] Deprecate compiler/packages/eslint-plugin-react-compiler - [ ] Update OSS release scripts to release eslint-plugin-react-hooks from compiler directory - [ ] Remove tsup from root workspace - [ ] Remove to-fast-properties from root workspace - [ ] Fix eslint-plugin-react-hook's tsconfig changes
closed
completed
poteto
2025-03-11T15:46:20
2026-03-28T19:54:54
2026-03-28T19:54:54
[ "Type: Enhancement", "Resolution: Stale" ]
[ "poteto" ]
0
{ "+1": 2 }
5
false
2026-03-29T04:53:27.101272
facebook
react
35,813
I_kwDOAJy2Ks7r5myA
false
[eslint-plugin-react-hooks] Bug: `react-hooks/refs` rule reporting false positive
Hi there! When updating to v7 of `eslint-plugin-react-hooks`, I'm getting an error that I haven't been getting on v5, and I believe it's a false positive. This is my functional component: ```ts function App() { const groupRefs = { group1: React.useRef<ComboBoxItemGroupDomRef>(null), group2: React.useRef<ComboBoxItemGroupDomRef>(null), }; // const group1Ref = React.useRef<ComboBoxItemGroupDomRef>(null); // const group2Ref = React.useRef<ComboBoxItemGroupDomRef>(null); return ( <ComboBox> <ComboBoxItemGroup ref={groupRefs.group1} // ref={group1Ref} headerText="Group 1" > <ComboBoxItem text="Item 1" /> </ComboBoxItemGroup> <ComboBoxItemGroup ref={groupRefs.group2} // ref={group2Ref} headerText="Group 2" > <ComboBoxItem text="Item 2" /> </ComboBoxItemGroup> </ComboBox> ); } ``` I'm keeping a list of refs for each group, and I'm passing each one into the group element. This gives me the following error: <img width="2734" height="1024" alt="Image" src="https://github.com/user-attachments/assets/e4b5708c-a93a-459f-bbcf-5a4e48afd973" /> I think the rule mistakenly interprets `groupRefs.group2` as referencing `ref.current`, which is not the case. If I don't collect all refs in an object but create an individual variable for each, I don't get an error. Steps to reproduce: + Open [this sandbox](https://stackblitz.com/edit/github-gjhxk4ip?file=src%2FApp.tsx). + Download it: <img width="1610" height="1395" alt="Image" src="https://github.com/user-attachments/assets/1b142665-1df4-4dea-aa79-3ea37ab7d752" /> + Run `npm install`, open in vscode. + You should get the error I screenshotted above. Thanks!
open
ej612
2026-02-18T12:57:25
2026-03-17T10:31:09
null
[ "Status: Unconfirmed" ]
null
0
{ "heart": 1 }
2
false
2026-03-29T04:53:21.626357
facebook
react
35,133
I_kwDOAJy2Ks7X9Cwb
false
Bug: Fallback image unnecessarily downloaded in `<picture>` element on Safari
When a <picture> element with a fallback image is rendered by React, Safari downloads both the fallback image and the correct image from the <source> element. This issue occurs only in Safari and results in the fallback image being downloaded unnecessarily. Reproduced on macOS Safari 18.6 React version: 19.2.0 ## Steps To Reproduce 1. Add the following tags inside a React component JSX : ``` <picture> <source media="(min-width:650px)" srcSet="https://www.w3schools.com/TAGS/img_pink_flowers.jpg" /> <source media="(min-width:465px)" srcSet="https://www.w3schools.com/TAGS/img_white_flower.jpg" /> <img src="https://www.w3schools.com/TAGS/img_orange_flowers.jpg" alt="Flowers" /> </picture> ``` 2. Open the app on Safari 3. Observe that 2 images are downloaded : the one corresponding to the screen size **and** the fallback image 4. Move the <picture> element to the root index.html so it is rendered outside of React 5. Observe that only the image corresponding to the screen size is downloaded Link to code example: https://codesandbox.io/p/sandbox/dreamy-swartz-rfm5wv ## The current behavior <img width="1288" height="477" alt="Image" src="https://github.com/user-attachments/assets/757a1a0e-1c79-4264-a242-e47d22cea59c" /> The fallback image is being downloaded unnecessarily. ## The expected behavior Only one picture should be downloaded, just like with other browsers.
open
bviale
2025-11-13T22:42:48
2026-03-17T11:19:19
null
[ "Status: Unconfirmed" ]
null
0
{}
10
false
2026-03-29T04:53:21.724934
facebook
react
35,728
I_kwDOAJy2Ks7pVb38
false
Bug: View Deployment is not working across react.dev and i18n documentation
This issue was escalated from the react.dev repository because there was no reply for over a week. https://github.com/reactjs/react.dev/issues/8281 > ### Summary > Hi team, > > Currently, the "View Deployment" for change previews isn't working, causing contributors to be directed to incorrect Vercel links. > > * "View Deployment" Button: > > <img alt="image" width="860" height="64" src="https://private-user-images.githubusercontent.com/119669540/542204231-e527c3e6-dbbc-445f-8e20-76209e33f2bc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzA2MTg3MzQsIm5iZiI6MTc3MDYxODQzNCwicGF0aCI6Ii8xMTk2Njk1NDAvNTQyMjA0MjMxLWU1MjdjM2U2LWRiYmMtNDQ1Zi04ZTIwLTc2MjA5ZTMzZjJiYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDIwOVQwNjI3MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MDdiYjVhZTdkZmNiMWMwM2EwNTc2MjkzYzVhNTZmYjZkYTY5MDdkMGM5MTc3NzQxMGQ4OTczMjQzNGYzNGRjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.kdIW6LZkKOhNGsaaFLEjWpHqJJl5pAY3x3X1vOKrzPk"> > * When I click the button: > > <img alt="image" width="1880" height="450" src="https://private-user-images.githubusercontent.com/119669540/542187154-da6acf1f-71b7-4243-9a2a-73583e510beb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzA2MTg3MzQsIm5iZiI6MTc3MDYxODQzNCwicGF0aCI6Ii8xMTk2Njk1NDAvNTQyMTg3MTU0LWRhNmFjZjFmLTcxYjctNDI0My05YTJhLTczNTgzZTUxMGJlYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDIwOVQwNjI3MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zY2JkYjY1MjRmNTUxYzZhM2FjZmE3Yjk0ZTdhMTdjM2EyYjkzNTViZmYxYzVjNjY0OGUyZmJhNmZjYzkwYzIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.qJt8nV73pAanV6qN7S1I_y2eIWldB6b73tf0J6W-ozQ"> > It stopped working at some point, and from my investigation, this problem affects the entire React documentation site, including react.dev and other i18n documentation. > > cc. [@rickhanlonii](https://github.com/rickhanlonii) > > ### Page > [#8277](https://github.com/reactjs/react.dev/pull/8277) > > ### Details > [#8277](https://github.com/reactjs/react.dev/pull/8277) > > Clicking the 'View Deployment' button in the link above doesn't work for external contributors.
open
lumirlumir
2026-02-09T06:29:14
2026-03-17T14:37:04
null
[ "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:21.765910
facebook
react
36,056
I_kwDOAJy2Ks7z3u6p
false
Bug:
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
open
siraprepaninnama-lab
2026-03-17T22:14:21
2026-03-18T10:00:10
null
[ "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:21.807654
facebook
react
35,125
I_kwDOAJy2Ks7Xt3IL
false
Bug: Performance regression due to deferTask not batching
## Overview Pulling this out of #35089 (read this for background) As mentioned above, https://github.com/facebook/react/pull/33030 introduced a fixed `MAX_ROW_SIZE=3200`, above which elements are deferred, which introduced a performance regression for certain payloads. A large part of the issue appears to be that the children aren't deferred in batches, they're deferred individually. This can result in many rows that are *far* smaller than the `MAX_ROW_SIZE` – because `renderModelDestructive` will call `deferTask` on each child, which then becomes its own lazy chunk, until all children have finished being serialized, and the `serializedSize` is reset again. ## Example I've created a [small reproduction](https://github.com/mhart/react-server-defer-task) that illustrates the problem. It's a ~120kb page with 20 sections each containing ~100 paragraphs. It can be made roughly 1.75x faster by better batching. Using plain React and `renderToReadableStream` this page renders in 1.02ms on Bun, and 1.27ms on Node.js. In Next.js (16.0.3) it's roughly 15x slower with the current batching strategy. This screenshot shows an example of what happens with the RSC stream: the first row reaches its limit after a few children, and starts deferring, but as you can see, each deferred child becomes its own row (a lazy chunk). So you can easily end up with hundreds or thousands of tiny rows if you're just synchronously rendering a table or similar. <img width="1611" height="1077" alt="Image" src="https://github.com/user-attachments/assets/4fe0d9ad-dc12-4fa7-b1e7-087fbebedd64" /> This example ends up with ~2000 rows, but each row is on average only 60 chars in length – far below the 3200 limit. And each row has non-trivial overhead as (in the Next.js case) it needs to serialized, de-serialized, and then re-serialized again (NB: this would be another optimization that would be good to tackle). Increasing the `MAX_ROW_SIZE` is one way to reduce the number of rendered rows which is what #35089 does and produces significant results, but a better fix would be to allow these children to be batched together into rows of ~MAX_ROW_SIZE length. That would obviate the need for #35089, or at least make it far less needed. Thanks to @gnoff for chatting some of this through too.
open
mhart
2025-11-13T02:50:26
2026-03-17T09:17:49
null
[ "Component: Server Components" ]
null
0
{ "+1": 6, "eyes": 4, "heart": 1 }
6
false
2026-03-29T04:53:21.853795
facebook
react
19,991
MDU6SXNzdWU3MTgyMTc4ODE=
false
Bug: Infinite rendering resulting in freezing of tab/browser
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React is not preventing infinite rendering/looping and results in freezing of browser. The root cause of this issue is because the dependency array of `useEffect` compares object/array by reference. But, this is a serious issue because - This is a common trap people might get into because of dynamic nature of Javascript, and people might not know the thing they are passing to dependency array is a primitive value or an array/object. - React should catch this infinite rendering and throw a helpful error. This error is already thrown by React for some of the cases. But, clearly React does not catch this for all the cases. - The documentation of `useEffect` does not have a single reference to this gotcha - guarding against passing object/array to the dependency array, since reference of the object/array is being checked, not a deep comparison value. Some solutions already exist like https://github.com/kentcdodds/use-deep-compare-effect, https://stackoverflow.com/questions/54095994/react-useeffect-comparing-objects/63965274#63965274. But, only people who are aware of this behaviour of `useEffect` will reach out to these solutions (or they might manually deep compare with their own custom hook as some people do in the linked stackoverflow link) It would also be helpful if `useEffect` includes a helpful option like ```javascript useEffect(() => { // myArray, myObject gets new reference on evey render }, [myArray, myObject], { deepCompare: true/false // it would be helpful to have this instead of reaching for custom hooks/npm packages }) ``` React version: `16.12.x` (any latest version) ## Steps To Reproduce 1. Click the `codesandbox` link - https://codesandbox.io/s/apollo-client-uselazyquery-example-forked-kmc1u?file=/src/App.js. 2. Click `Topics` link and then select `Countries` link. `Warning`: Please be aware that tab/browser will freeze. It is better to open the console before hand, so that you can see the looping from console logs. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: [CodeSandbox reproduction](https://codesandbox.io/s/apollo-client-uselazyquery-example-forked-kmc1u?file=/src/App.js) <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> Current behavior: - React does not prevent infinite loop/rendering. Browser tab freezes, and the end user has no idea that the tab has freezed. They have to force quit the tab. Expected behavior: - React should give a helpful warning that an infinite render/loop is going on. - React should pinpoint the exact issue - the array/object passed to `useEffect` dependency is triggering infinite rendering
open
palerdot
2020-10-09T15:01:20
2026-03-18T08:18:40
null
null
null
0
{ "+1": 10 }
20
false
2026-03-29T04:53:21.986263
facebook
react
35,576
I_kwDOAJy2Ks7kmD47
false
Bug: The ESLint react-hooks/immutability rule warns against using a callback internally
eslint-plugin-react-hooks version: 7.0.1 ## Steps To Reproduce ```tsx const Test: FC = () => { const onMouseDown = useCallback(() => { // warns here about using onMouseDown window.removeEventListener('mousedown', onMouseDown); }, []); useEffect(() => { window.addEventListener('mousedown', onMouseDown); return () => { window.removeEventListener('mousedown', onMouseDown); }; }, [onMouseDown]); return <div>Hello</div>; }; ``` ## The current behavior ``` `onMouseDown` is accessed before it is declared, which prevents the earlier access from updating when this value changes over time. ``` ## The expected behavior No errors
open
4eb0da
2026-01-20T19:46:30
2026-03-18T10:40:45
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 1 }
4
false
2026-03-29T04:53:22.023475
facebook
react
36,100
I_kwDOAJy2Ks70Xz0E
false
[spam]
[spam]
closed
not_planned
Guidese
2026-03-19T07:30:17
2026-03-19T15:48:14
2026-03-19T15:48:14
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:22.148404
facebook
react
36,098
I_kwDOAJy2Ks70XV4h
false
[spam]
[spam]
closed
not_planned
Guidese
2026-03-19T07:00:03
2026-03-19T16:40:44
2026-03-19T16:40:44
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:22.181976
facebook
react
35,182
I_kwDOAJy2Ks7ZgaIM
false
Bug:
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
closed
not_planned
luisfernando30077-lgtm
2025-11-20T21:25:59
2026-03-18T16:26:59
2026-03-18T16:26:59
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "heart": 1 }
3
false
2026-03-29T04:53:22.216702
facebook
react
36,005
I_kwDOAJy2Ks7xzeSM
false
✨ [Feature Request] 支持删除列表功能
## 功能请求:删除列表 ### 描述 希望 React 能够提供更便捷的方式来删除列表中的元素。 ### 使用场景 在开发中经常需要从列表(数组)中删除某个元素,并触发组件重新渲染。希望有更简洁的 API 或内置支持来处理此类操作。 ### 期望行为 - 提供一个简单易用的方式删除列表中的单个或多个元素 - 删除后自动触发组件更新 ### 当前行为 目前需要手动使用 `filter` 或 `splice` 等方法处理,缺乏统一的抽象。 ### 附加信息 - React 版本:最新版 - 环境:Web
open
wangzifei240303-tech
2026-03-11T08:49:32
2026-03-19T12:16:47
null
null
null
0
{ "heart": 2 }
0
false
2026-03-29T04:53:22.257220
facebook
react
36,006
I_kwDOAJy2Ks7x0jMM
false
[DevTools Bug] Commit tree already contains fiber "21". This is a bug in React DevTools.
### Website or app http://localhost:5173/ ### Repro steps 1. Вошел на страницу, 2. Нажал F5, 3. Во время перезагрузки нажал record в Profiler ### How often does this bug happen? Sometimes ### DevTools package (automated) react-devtools-extensions ### DevTools version (automated) 7.0.1-3cde211b0c ### Error message (automated) Commit tree already contains fiber "21". This is a bug in React DevTools. ### Error call stack (automated) ```text at updateTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:699600) at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:698760) at $e.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:703384) at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1005870) at renderWithHooks (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:66940) at updateFunctionComponent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:97513) at beginWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:111594) at performUnitOfWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184246) at workLoopSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184102) at renderRootSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:183886) ``` ### Error component stack (automated) ```text at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1005671) at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:879909) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1144384 at ao (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:898411) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901313 at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at SuspenseTreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1147064) at InspectedElementContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:915935) at TimelineContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:994422) at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:986233) at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:786019) at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:815755) at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:972480) at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1175879) ``` ### GitHub query string (automated) ```text https://api.github.com/search/issues?q=Commit tree already contains fiber . This is a bug in React DevTools. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react ```
open
PlagiatXXX
2026-03-11T09:42:49
2026-03-19T12:16:45
null
[ "Type: Bug", "Status: Unconfirmed", "Component: Developer Tools" ]
null
0
{ "+1": 1, "heart": 1 }
0
false
2026-03-29T04:53:22.284466
facebook
react
36,099
I_kwDOAJy2Ks70XmCE
false
[spam]
[spam]
closed
not_planned
Guidese
2026-03-19T07:15:02
2026-03-19T16:54:21
2026-03-19T16:54:21
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:22.311565
facebook
react
6,646
MDU6SXNzdWUxNTE3MjE1Njg=
false
Sending events from parents to children easily
Been using React (Native) for half a year now, really enjoying it! I'm no expert but have run up against what seems like a weakness in the framework that I'd like to bring up. **The problem** _Sending one-off events down the chain (parent-to-child) in a way that works with the component lifecycle._ The issue arises from the fact that props are semi-persistent values, which differs in nature from one-time events. So for example if a deep-link URL was received you want to say 'respond to this once when you're ready', not 'store this URL'. The mechanism of caching a one-time event value breaks down if the same URL is then sent again, which is a valid event case. Children have an easy and elegant way to communicate back to parents via callbacks, but there doesn't seem to be a way to do this same basic thing the other direction. **Example cases** - A deep-link was received and an app wants to tell child pages to respond appropriately - A tab navigator wants to tell a child to scroll to top on secondary tap - A list view wants to trigger all of its list items to animate each time the page is shown From everything I've read, the two normal ways to do this are 1) call a method on a child directly using a ref, or 2) emit an event that children may listen for. But those ignore the component lifecycle, so the child isn't ready to receive a direct call or event yet. These also feel clunky compared to the elegance of React's architecture. But React is a one-way top-down model, so the idea of passing one-time events down the component chain seems like it would fit nicely and be a real improvement. **Best workarounds we've found** - Add a 'trigger' state variable in the parent that is a number, and wire this to children. Children use a lifecycle method to sniff for a change to their trigger prop, and then do a known action. We've done this a bunch now to handle some of the cases listed above. - (really tacky) Set and then clear a prop immediately after setting it. Yuck. Is there is some React Way to solve this common need? If so, no one on our team knows of one, and the few articles I've found on the web addressing component communication only suggest dispatching events or calling methods directly refs. Thanks for the open discussion!
closed
completed
mosesoak
2016-04-28T19:17:20
2026-03-18T11:31:46
2016-04-28T22:21:41
null
null
0
{ "+1": 25 }
13
false
2026-03-29T04:53:22.342544
facebook
react
34,934
I_kwDOAJy2Ks7S2dKN
false
Bug: Unable to run `yarn build` on the newest main
## Steps To Reproduce 1. Clone React repo or clean the repo with `git clean -fdx` 2. Run `yarn` and `yarn build` ## The current behavior I'm getting an error while building `eslint-plugin-react-hooks.development.js`: ``` BUILDING jest-react.production.js (node_prod) COMPLETE jest-react.production.js (node_prod) Running: mkdir -p ./compiler/packages/babel-plugin-react-compiler/dist && echo "module.exports = require('../src/index.ts');" > ./compiler/packages/babel-plugin-react-compiler/dist/index.js BUILDING eslint-plugin-react-hooks.development.js (node_dev) @rollup/plugin-typescript TS7016: Could not find a declaration file for module '@babel/code-frame'. '/Users/blazejkustra/Documents/react/node_modules/@babel/code-frame/lib/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/babel__code-frame` if it exists or add a new declaration (.d.ts) file containing `declare module '@babel/code-frame';` error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` ## The expected behavior Successful build
closed
not_planned
blazejkustra
2025-10-21T17:21:26
2026-03-20T14:19:40
2026-03-20T14:19:40
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{}
5
false
2026-03-29T04:53:22.630866
facebook
react
36,122
I_kwDOAJy2Ks71DjKX
false
Bug:
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
open
Abdumutalib
2026-03-21T04:22:23
2026-03-22T09:13:39
null
[ "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:22.674009
facebook
react
36,101
I_kwDOAJy2Ks70a15e
false
Bug: react-hooks/set-state-in-effect fails to flag violation if prop has a `NewExpression` default value
The react-hooks/set-state-in-effect rule fails to flag a violation when a component's destructured prop has a default value that is a NewExpression (new Foo()). react version: 18.3.1 eslint-plugin-react-hooks: 7.0.1 ## Steps To Reproduce ```tsx // ❌ Should flag — but doesn't function MyComponent({ value = new Number() }) { const [x, setX] = useState(false) useEffect(() => { setX(true) }, [x]) return null } // ✅ Correctly flags — literal default function MyComponent({ value = Number() }) { const [x, setX] = useState(false) useEffect(() => { setX(true) }, [x]) return null } ```
open
Romej
2026-03-19T10:11:50
2026-03-19T23:55:07
null
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:22.734698
facebook
react
32,135
I_kwDOAJy2Ks6m1OqI
false
Bug: Properties are not passed to Custom Elements that extend built-in elements
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19.0.0 ## Steps To Reproduce 1. Define a Custom Element `x-custom-link` that extends the `a` element 2. Render the custom element using the `is` attribute: `<a is="x-custom-link"></a>` 3. Pass a property to the element <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/p/sandbox/musing-shadow-ttt8hc <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Properties are correctly passed to autonomous custom elements but not to those that extend builtin elements. ## The expected behavior Properties are passed to custom elements that extend builtin elements as well.
open
edoardocavazza
2025-01-20T11:14:56
2026-03-20T18:16:02
null
[ "Status: Unconfirmed" ]
null
0
{}
10
false
2026-03-29T04:53:22.813993
facebook
react
34,884
I_kwDOAJy2Ks7SAiHi
false
Bug: Flow definitions are missing for React 19
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19 ## Steps To Reproduce 1. Use flow-typed 2. Get Flow definitions <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://github.com/flow-typed/flow-typed/tree/main/definitions/npm/react-dom_v18.x.x <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior only 18 is available ## The expected behavior https://github.com/flow-typed/flow-typed/tree/main/definitions/npm/react-dom_v19.x.x should exist
closed
not_planned
Dagur
2025-10-16T20:06:24
2026-03-23T12:20:22
2026-03-23T12:20:22
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{}
4
false
2026-03-29T04:53:22.921327
facebook
react
35,372
I_kwDOAJy2Ks7eolUJ
false
Bug: Fiber Scheduler Overhead Under Heavy Suspense Trees
Large Suspense boundaries create nested work units that increase reconciliation time due to excessive yielding. A micro-optimization in beginWork to short‑circuit noop boundaries would reduce UI stalls in concurrent mode.
closed
not_planned
shareefmx
2025-12-16T15:02:49
2026-03-23T16:22:46
2026-03-23T16:22:46
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{}
2
false
2026-03-29T04:53:23.027808
facebook
react
34,172
I_kwDOAJy2Ks7FXMoA
false
[Compiler Bug]: Memoization: Compilation skipped because existing memoization could not be preserved
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhHCA7MAXABAUQA8AHBLASwDcEBhCAW2MzLwF5d6F6IAKAMygY42cpgIkyYKrQZMMLHsFwATAIbZVAGlyYaAG3JwA1rgC+ASlzAAOhly50WPMRgREYMAmUARdatzsUJ4Asly8PJasAHxWtvb2MAjYsHYIEhTUAAqu7lIYAOY8ahrmANxxZtoA2sWqALplthWOOLgAFqoYynq0BsYBuEG0qnp6AEaqxjw85NhckTE2dvG6fUYzc-QAdOTKjcum1auGRg3lGBWJyTB2PBX2ADzKVFH38cAubggeXr4aW-RVMQNlwAjE7st4vEnlRcEYEABPVjAWZcHbKUw6DD6E7IiJg9qdbq9E4g+jmTEAelekPi5gpbwelOelBp9n2FnOtgEQhEYjSpAyCGyXw85AKRT8liWCSSKRUfnOphApiAA ### Repro steps 1. Copy the component from the https://react.dev/learn/react-compiler/introduction#before-react-compiler section in the playground 2. Notice `useMemo` shows a compilation error ``` Memoization: Compilation skipped because existing memoization could not be preserved React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output. ``` ### How often does this bug happen? Every time ### What version of React are you using? latest (I believe) ### What version of React Compiler are you using? latest
closed
completed
amanmahajan7
2025-08-11T18:36:40
2026-03-20T18:44:42
2026-03-20T18:44:41
[ "Type: Bug", "Status: Unconfirmed", "Component: React Compiler" ]
null
0
{ "eyes": 4 }
15
false
2026-03-29T04:53:23.092105
facebook
react
36,120
I_kwDOAJy2Ks70_rcz
false
Bug: Suspense wrapped component does not update correctly
When a server component is wrapped with Suspense tag, `revalidatePath` does not work correctly. Only when `npm run build && npm run start` React version: 19.2.4 Next.js version: 16.2.0 ## Steps To Reproduce 1. Wrap a Server component (list of item) with Suspense tag 2. `npm run build && npm run start` 3. Delete an item with the UI button (will delete and revalidatePath) 4. See not UI update after the request / response Link to code example: https://github.com/vercel/next-learn/blob/main/dashboard/final-example/app/dashboard/invoices/page.tsx I tried to reproduce the bug on CodeSandbox, but i think the cache / revalidatePath does not work as my own machine. Sorry. The code is maybe not the best, i did the Acme course on NextJS 16. If there is some better pratice, i will be glad to learn them. (except the interaction with Data, i will do an API for that i think. Server action will retrieve some data from an external API) ```tsx // app/dashboard/invoices/page.tsx import Pagination from '@/app/ui/invoices/pagination'; import Search from '@/app/ui/search'; import Table from '@/app/ui/invoices/table'; import { CreateInvoice } from '@/app/ui/invoices/buttons'; import { lusitana } from '@/app/ui/fonts'; import { InvoicesTableSkeleton } from '@/app/ui/skeletons'; import { Suspense } from 'react'; import { fetchInvoicesPages } from '@/app/lib/data'; export default async function Page(props: { searchParams?: Promise<{ query?: string; page?: string }> }) { const searchParams = await props.searchParams; const query = searchParams?.query || ''; const pageParameter = Number.parseInt(searchParams?.page || '1', 10); const currentPage = Number.isNaN(pageParameter) || pageParameter < 1 ? 1 : pageParameter; const totalPages = await fetchInvoicesPages(query); return ( <div className="w-full"> <div className="flex w-full items-center justify-between"> <h1 className={`${lusitana.className} text-2xl`}>Invoices</h1> </div> <div className="mt-4 flex items-center justify-between gap-2 md:mt-8"> <Search placeholder="Search invoices..." /> <CreateInvoice /> </div> <Suspense key={query + currentPage} fallback={<InvoicesTableSkeleton />}> <Table query={query} currentPage={currentPage} /> </Suspense> <div className="mt-5 flex w-full justify-center"> <Pagination totalPages={totalPages} /> </div> </div> ); } ``` ```tsx // app/ui/invoices/table.tsx import Image from 'next/image'; import { UpdateInvoice, DeleteInvoice } from '@/app/ui/invoices/buttons'; import InvoiceStatus from '@/app/ui/invoices/status'; import { formatDateToLocal, formatCurrency } from '@/app/lib/utils'; import { fetchFilteredInvoices } from '@/app/lib/data'; export default async function InvoicesTable({ query, currentPage }: { query: string; currentPage: number }) { const invoices = await fetchFilteredInvoices(query, currentPage); return ( <div className="mt-6 flow-root"> <div className="inline-block min-w-full align-middle"> <div className="rounded-lg bg-gray-50 p-2 md:pt-0"> ... <table className="hidden min-w-full text-gray-900 md:table"> <thead className="rounded-lg text-left text-sm font-normal"> <tr> <th scope="col" className="px-4 py-5 font-medium sm:pl-6"> Customer </th> <th scope="col" className="px-3 py-5 font-medium"> Email </th> <th scope="col" className="px-3 py-5 font-medium"> Amount </th> <th scope="col" className="px-3 py-5 font-medium"> Date </th> <th scope="col" className="px-3 py-5 font-medium"> Status </th> <th scope="col" className="relative py-3 pl-6 pr-3"> <span className="sr-only">Edit</span> </th> </tr> </thead> <tbody className="bg-white"> {invoices?.map((invoice) => ( <tr key={invoice.id} className="w-full border-b py-3 text-sm last-of-type:border-none [&:first-child>td:first-child]:rounded-tl-lg [&:first-child>td:last-child]:rounded-tr-lg [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg" > <td className="whitespace-nowrap py-3 pl-6 pr-3"> <div className="flex items-center gap-3"> <Image src={invoice.image_url} className="rounded-full" width={28} height={28} alt={`${invoice.name}'s profile picture`} /> <p>{invoice.name}</p> </div> </td> <td className="whitespace-nowrap px-3 py-3">{invoice.email}</td> <td className="whitespace-nowrap px-3 py-3">{formatCurrency(invoice.amount)}</td> <td className="whitespace-nowrap px-3 py-3">{formatDateToLocal(invoice.date)}</td> <td className="whitespace-nowrap px-3 py-3"> <InvoiceStatus status={invoice.status} /> </td> <td className="whitespace-nowrap py-3 pl-6 pr-3"> <div className="flex justify-end gap-3"> <UpdateInvoice id={invoice.id} /> <DeleteInvoice id={invoice.id} /> </div> </td> </tr> ))} </tbody> </table> </div> </div> </div> ); } ``` ```tsx // app/ui/invoices/buttons.tsx ... export function DeleteInvoice({ id }: { id: string }) { const deleteInvoiceWithId = deleteInvoice.bind(null, id); return ( <form action={deleteInvoiceWithId}> <button type="submit" className="rounded-md border p-2 hover:bg-gray-100"> <span className="sr-only">Delete</span> <TrashIcon className="w-5" /> </button> </form> ); } ``` ```ts // app/lib/action.ts ... export async function deleteInvoice(id: string) { try { await sql`DELETE FROM invoices WHERE id = ${id}`; } catch (error) { console.error(error); // Add toast for error ? return; } revalidatePath('/dashboard/invoices'); } ``` ## The current behavior When deleting an item, the UI is not refreshed. ## The expected behavior With revalidatePath, we should have an UI up to date after deleting an element.
open
MaxencePaulin
2026-03-20T22:06:17
2026-03-24T13:50:39
null
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:23.155511
facebook
react
36,097
I_kwDOAJy2Ks70XB-V
false
Bug: Flight Client wraps elements in lazy chunks when `debugChannel` is enabled, causing `isValidElement()` to return false
React version: 19.3.0-canary (tested from `f93b9fd4-20251217` through `b4546cd0-20260318`) ## Steps To Reproduce 1. Run the standalone reproduction: ```bash git clone https://github.com/Gyeonghun-Park/react-flight-debugchannel-repro cd react-flight-debugchannel-repro npm install npm test ``` 2. Observe the output: ``` React 19.3.0-canary-f93b9fd4-20251217 (NODE_ENV=development) Without debugChannel: isValidElement: true $$typeof: Symbol(react.transitional.element) With debugChannel (debug data delayed 50 ms): isValidElement: false $$typeof: Symbol(react.lazy) ✗ Bug reproduced: Flight Client returned a lazy wrapper instead of a React element when debugChannel is enabled. ``` Link to code example: https://github.com/Gyeonghun-Park/react-flight-debugchannel-repro The test renders `<ClientComponent><div>hello</div></ClientComponent>` via Flight Server, deserializes it via Flight Client, then checks `isValidElement()` on the result. A 50ms delay on the debug channel stream simulates real-world conditions where debug info is delivered via a separate transport (e.g. WebSocket). ### Real-world reproduction (Next.js) This issue was originally discovered via Next.js 16.2.0, which recently changed the default of `experimental.reactDebugChannel` from `false` to `true`. A visual reproduction with browser hydration is available at: https://github.com/Gyeonghun-Park/next-isvalidelement-repro Setting `experimental: { reactDebugChannel: false }` in `next.config.ts` immediately resolves the issue, which is what led us to identify `debugChannel` as the trigger. ## The current behavior When `debugChannel` is passed to `createFromNodeStream` (or `createFromReadableStream`) and the debug data arrives after the element data, deserialized React elements are wrapped in `createLazyChunkWrapper` with `$$typeof: Symbol(react.lazy)`. As a result: - `React.isValidElement()` returns `false` - `React.cloneElement()` throws - Hydration mismatches occur (SSR renders with `true`, client re-renders with `false`) This affects any code that calls `isValidElement()` or `cloneElement()` on children crossing the RSC boundary, including patterns like Radix UI's `asChild` / `Slot`. The issue is **dev mode only** — production builds are unaffected. ## The expected behavior Elements deserialized by the Flight Client should be recognized by `isValidElement()` regardless of whether `debugChannel` is enabled. Dev-only debug metadata (owner/stack at element positions 4/5) should not change the observable type of deserialized elements. ## Analysis > **Note:** This analysis is based on reading the compiled Flight Client source code. I may have some details wrong — happy to be corrected. In `ReactFlightClient.js`, `waitForReference` has a guard that normally skips incrementing `deps` for pending debug-only element fields (positions 4 and 5): ```js function waitForReference(referencedChunk, parentObject, key, response, ...) { if (!( (response._debugChannel && response._debugChannel.hasReadable) || "pending" !== referencedChunk.status || parentObject[0] !== REACT_ELEMENT_TYPE || ("4" !== key && "5" !== key) )) return null; // skip — don't increment deps initializingHandler.deps++; } ``` When `debugChannel` is active (`hasReadable = true`), the first condition short-circuits the guard, so `deps` gets incremented for all pending references — including the dev-only debug fields. Later, during element construction, `deps > 0` causes the element to be wrapped in `createLazyChunkWrapper` instead of being returned directly. With `debugChannel`, the Flight Server sends debug info on a separate stream. In real-world streaming (e.g. Next.js delivers debug data via WebSocket), this data can arrive after the main element data. When the Flight Client processes the element chunk, the debug info chunks at positions 4/5 are still "pending" — and with the guard bypassed, this causes lazy wrapping. Production builds exclude positions 4/5 entirely, so `deps` stays 0 and elements are returned directly. ### Additional confirmation Patching the compiled Flight Client in Next.js to skip the `if (0 < key.deps)` block resolved the issue entirely — all `isValidElement()` calls returned `true` and hydration succeeded without mismatches. (Obviously not a real fix, just validation of the code path.) ## Tested canaries | Canary | Without `debugChannel` | With `debugChannel` + delay | | --------------------------------- | ---------------------- | --------------------------- | | `19.3.0-canary-f93b9fd4-20251217` | ✅ works | ❌ lazy wrapper | | `19.3.0-canary-3a2bee26-20260218` | ✅ works | ❌ lazy wrapper | | `19.3.0-canary-2ba30655-20260219` | ✅ works | ❌ lazy wrapper | | `19.3.0-canary-3f0b9e61-20260317` | ✅ works | ❌ lazy wrapper | | `19.3.0-canary-b4546cd0-20260318` | ✅ works | ❌ lazy wrapper | The behavior is consistent across all tested versions, which suggests this is a pre-existing issue in the `debugChannel` code path rather than a regression from a specific PR. ## Environment - Dev mode only (production unaffected) - Reproducible with both Turbopack and Webpack (via Next.js) - Node.js 24.14.0, macOS arm64 Thank you for your time! Happy to provide additional information, test patches, or adjust the reproduction if needed.
open
Gyeonghun-Park
2026-03-19T06:40:00
2026-03-24T06:49:16
null
null
null
0
{}
2
false
2026-03-29T04:53:23.204453
facebook
react
35,821
I_kwDOAJy2Ks7sBjeN
false
Bug: useDeferredValue gets stuck with a stale value
Essentially, I see `useDeferredValue` being stuck and never catching up. Not sure if it's possible to extract it out of a Next.js app. I think it's probably a React bug because it seems related to core APIs, but I couldn't simplify it past the "render some JSX from server action" repro case. ## Demo Type "hello world". In dev (`npm run dev`), the second text area catches up. In prod (`npm run build + npm start`), the second text area often gets stuck and never catches up. https://github.com/user-attachments/assets/a44f01ad-1a7d-4420-a6da-cadb277ded72 ## Code Here is a repro case: https://github.com/gaearon/react-udv-bug/ This is the main harness: ```js export function TestPreviewClient() { const [promise, setPromise] = useState<Promise<ReactNode>>(initialPromise); const deferred = useDeferredValue(promise); function handleChange(value: string) { setPromise(renderAction(value)); } return ( <div style={{ padding: 16, fontFamily: "monospace" }}> <textarea placeholder="type here" onChange={(e) => handleChange(e.target.value)} rows={3} style={{ width: "100%", fontFamily: "monospace" }} /> <div data-testid="deferred" style={{ border: "1px solid #ccc", padding: 8, minHeight: 40 }} > <Suspense fallback={<div>loading...</div>}> <Resolved promise={deferred} /> </Suspense> </div> </div> ); } ``` Note these helpers: ```js export function ClientWrapper({ children }: { children: ReactNode }) { const t = performance.now(); while (performance.now() - t < 2) { // do nothing } return <>{children}</>; } function Resolved({ promise }: { promise: Promise<ReactNode> }) { return <>{use(promise)}</>; } ``` And this is the server part: ```js async function AsyncChild({ children, }: { children: ReactNode; }): Promise<ReactNode> { await new Promise((r) => setTimeout(r, 1)); return children; } async function Item({ children }: { children: ReactNode }): Promise<ReactNode> { return ( <ClientWrapper> <AsyncChild>{children}</AsyncChild> </ClientWrapper> ); } export async function renderAction(input: string): Promise<ReactNode> { return ( <Item> <div> <Item> <div>{input}</div> </Item> </div> </Item> ); } ``` You can generally simplify this structure but then it will be harder to reproduce.
closed
completed
gaearon
2026-02-18T21:15:25
2026-03-24T01:03:16
2026-03-24T00:49:06
[ "Type: Bug", "Component: Suspense" ]
null
0
{}
6
false
2026-03-29T04:53:23.249033
facebook
react
10,506
MDU6SXNzdWUyNTE4MTA1ODA=
false
Symbol Tagging for dangerouslySetInnerHTML to Help Prevent XSS
If you're spreading props from a user provided source we have a XSS. E.g. ```js var data = JSON.parse(decodeURI(location.search.substr(1))); function Foo(props) { return <div><div {...props} /><span>{props.content}</span></div>; } ReactDOM.render(<Foo {...data} />, container); ``` That's already true today because this URL is now an XSS hole: ``` ?{"content":"Hello","dangerouslySetInnerHTML":{"__html":"<a%20onclick=\"alert(%27p0wned%27)\">Click%20me</a>"}} ``` This is very uncommon. There are many different ways to screw up getting user data. However doing that + also spreading is unusual. We decided in #3473 that React should add an extra layer of protection for these types of mistakes. This one is __much__ more uncommon than the one in #3473 though. You should already have a pretty centralized way of sanitizing these objects so it seems to me that adding a Symbol to this object shouldn't be that big of a deal though. Either: ```js { $$typeof:Symbol.for('react.rawhtml'), __html: myHTML } ``` or: ```js { [Symbol.for('react.rawhtml')]: myHTML } ```
open
sebmarkbage
2017-08-22T01:13:23
2026-03-24T07:54:45
null
[ "Component: DOM", "Type: Discussion", "React Core Team" ]
null
0
{ "+1": 19, "confused": 1 }
5
false
2026-03-29T04:53:23.301237
facebook
react
36,057
I_kwDOAJy2Ks7z4pmU
false
[Compiler Bug]: React Compiler removes optional chaining due to incorrect assumption from `useEffect` access
### What kind of issue is this? - [x] React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization) - [ ] babel-plugin-react-compiler (build issue installing or using the Babel plugin) - [ ] eslint-plugin-react-hooks (build issue installing or using the eslint plugin) - [ ] react-compiler-healthcheck (build issue installing or using the healthcheck script) ### Link to repro https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEwBUYCAyngIZ4IA0JZAogGYsJyEC+BLMEGAgB0QMBFU4ihAOxkIAHjnwEAJghZUoAG0Iso0zmgjSCAQSxYAFAEoiMggTjGwhANpqAbmkRgGZPAAiCF4+ALoEALyMFNS0lq6h1vaOzm5wsGLSgcHeCACS0mryfgh4AMIZCFlBIfmFCuFRpDE0CJYADEmyJinSLo6V1TmIkarDCGCu6TCZ2bUFRaEyyc2s7JyWNpEAfHY9DlRgAJ4GvPqGxgRaEADmW8DJDg5OfRBaCAB013fTszW5HwgYC6TwIXEeBDQLAIll+VTmuVs3xsyS4DCmgwRiESyx6YjwsBMlghAB4VGgPNsIQ5PLkCHgjlgEMgHiBhCBwfsnsA4UNagB+D4MpkEAA+oupT1hmP+iEFQMFGBocAAFpYAPRUQr8NAqUVGMDqtC2fnsjAQABGaHeIgIyHZajAAGs8BAsCJrJzQST1eTKckupyQHQQC8WGgbih0NhcIRhQgiAQAApaKA3NDSADyWDwRj6YN4-EEAHILVQLQgtABaLCp9PSKtiCR4KtObDWhAwX1oFzFgDcuMsDx66vVbaw1poeYAshA1PaRFQtFopNIeGAp2BwxNk3WM9nc85rH3g+AVRAAO4FWgwaRLsAoDRaMhcIA ### Repro steps The React Compiler incorrectly removes optional chaining (`?.`) and replaces it with direct property access. This appears to be caused by an unsafe assumption that `currentDevice` is always defined, based on its usage inside a `useEffect`. --- **Original Code** ```js import { useState, useEffect } from "react" export default function Scanner() { const [devices, setDevices] = useState([]) const [currentDeviceIndex, setCurrentDeviceIndex] = useState(0) const currentDevice = devices[currentDeviceIndex] useEffect(() => { async function log() { console.log(currentDevice.os) } if (currentDevice) log() }, [currentDevice]) return ( <div> device type:{" "} {currentDevice?.type || (currentDevice?.os?.match(/android|ios/i) ? "mobile" : "desktop")} </div> ) } ``` --- **Compiled Output (Problematic)** ```js if ($[4] !== currentDevice.os || $[5] !== currentDevice.type) { ``` --- **Issue** The compiler transforms safe optional chaining: ```js currentDevice?.os currentDevice?.type ``` into unsafe direct access: ```js currentDevice.os currentDevice.type ``` --- **Root Cause (Incorrect Assumption)** The compiler appears to infer that `currentDevice` is always defined because of this code: ```js useEffect(() => { async function log() { console.log(currentDevice.os) } if (currentDevice) log() }, [currentDevice]) ``` However, this assumption is **incorrect** because: - `currentDevice.os` is accessed **inside a function (`log`)** - That function is **only invoked conditionally when `currentDevice` is truthy** - There is **no guarantee** that `currentDevice` is defined outside that guarded call --- **Why this is a bug** When `currentDevice` is `undefined` (which is valid in this component, since `devices` is initially an empty array): ```js const currentDevice = devices[currentDeviceIndex] // undefined ``` the compiled code throws: ``` TypeError: Cannot read properties of undefined (reading 'os') ``` --- **Expected Behavior** The compiler should preserve null safety by: - Keeping optional chaining, or - Adding appropriate guards before property access Example of safe output: ```js if ($[4] !== currentDevice?.os || $[5] !== currentDevice?.type) { ``` --- **Impact** - Introduces runtime crashes in otherwise safe React code - Breaks correctness of compiled output ### How often does this bug happen? Every time ### What version of React are you using? 19.2.0 ### What version of React Compiler are you using? 1.0.0
open
rmhaiderali
2026-03-17T23:18:19
2026-03-24T13:50:41
null
[ "Type: Bug", "Status: Unconfirmed" ]
null
0
{}
1
false
2026-03-29T04:53:23.345914
facebook
react
33,399
I_kwDOAJy2Ks65OtxK
false
Feature Request: [eslint-plugin-react-hooks] Provide a way for custom hooks with a dependency array to accept seemingly redundant dependencies
- #33041 Since React doesn't provide a native way to define a dependency array for resetting state, I have to resort to a user-land implementation of this functionality. Here is the signature of the hook I use: ```ts function useDerivedState<S>( initialState: S | ((previousState?: S) => S), deps: DependencyList, ): [S, Dispatch<SetStateAction<S>>] ``` Please check https://github.com/facebook/react/issues/33041#issuecomment-2923900312 for details and full code. In order to get warnings about missing dependencies, I add this rule to my ESLint config: ```ts 'react-hooks/exhaustive-deps': [ 'warn', { additionalHooks: 'useDerivedState' }, ] ``` Unfortunately, that leads to warnings in cases where there shouldn't be any. Here is an example: ```ts const [collapsed, setCollapsed] = useDerivedState(() => true, [collapsible]); ``` The reason is that `collapsible` is listed as a dependency, but not present in the initializer function's body, so the linter plugin thinks it's unnecessary. However, this is intended: it is desired that `collapsed` is reset to `true` whenever `collapsible` changes. Such seemingly redundant dependencies are currently only accepted for the effects family of hooks. They got this special treatment shortly after the `exhaustive-deps` rule was introduced, see https://github.com/facebook/react/issues/14920#issuecomment-471070149. The test for whether a hook belongs to the effects family is very simple: it's enough that the hook's name includes the substring `"Effect"` at the end of it, or followed by a symbol other than a lowercase letter. https://github.com/facebook/react/blob/ee76351917106c6146745432a52e9a54a41ee181/packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts#L1334 Now, I could of course rename my `useDerivedState` hook to something like `useDerivedStateEffect`, but this would be a despicable misnomer since not only is the hook's functionality nothing like that of `useEffect`, but also its whole idea is to fight how effects are used all over the place for deriving state despite it being a terrible anti-pattern (#33041 has a detailed explanation). A couple more workarounds I can think of: 1. ```ts // eslint-disable-next-line react-hooks/exhaustive-deps const [collapsed, setCollapsed] = useDerivedState(true, [collapsible]); ``` Simply suppressing the warning. Dirty. 2. ```ts const [collapsed, setCollapsed] = useDerivedState(() => { collapsible; // eslint-disable-line @typescript-eslint/no-unused-expressions return true; }, [collapsible]); ``` Forcing `collapsible` to be referenced in the initializer function's body, but now a different warning has to be suppressed. This is more verbose and a little confusing, but especially in more complex cases where we don't only have one single dependency, I would go for this option because I wouldn't want to disable the `exhaustive-deps` rule completely. (By the way, Biome's `useExhaustiveDependencies` rule [allows ignoring only a specific dependency](https://biomejs.dev/linter/rules/use-exhaustive-dependencies/#ignoring-a-specific-dependency). This alone make me kind of want to give Biome a try. Very inspiring!) 3. ```ts const [collapsed, setCollapsed] = useDerivedState(() => { return collapsible || true; }, [collapsible]); ``` There shouldn't be any problem with this, right? Well, turns out there is, and it's that with this code, TypeScript for whatever reason decides that the type of `collapsed` is `true` rather than `boolean`, so it has to be specified manually: ```ts const [collapsed, setCollapsed] = useDerivedState<boolean>(() => { return collapsible || true; }, [collapsible]); ``` I'm really clueless about why TypeScript thinks `collapsible || true` is of type `true` while a simple `true` expression is of type `boolean`. Probably I should open an issue about this in TypeScript's repo, but if anyone here has any idea, please let me know 🙏 Anyway, I shouldn't be writing stupid code like this just to get around the linter plugin's limitations. I suggest introducing support for the following kind of configuration: ```ts 'react-hooks/exhaustive-deps': ['warn', { additionalHooks: [ { name: 'useDerivedState', allowExtraDeps: true }, { name: 'useDefinitelyNotAnEffect', allowExtraDeps: false }, /^(useMyCustomHook|useMyOtherCustomHook)$/, ] }] ``` Probably quite self-explanatory, but here are some details: - `additionalHooks` can now accept objects of this shape: ```ts { name: string | RegExp, allowExtraDeps?: boolean } ``` If `allowExtraDeps` is undefined, the decision on whether to report seemingly redundant dependencies should be made just the same way it is made now. Otherwise, it should be based on that property's value. - I think it's better not to convert the `name` properties from string to regexes, but treat strings as values that should be matched exactly. Before, regexes couldn't be used directly because the config file had to be in JSON format, and that is why strings were converted to regexes. With the new flat config format, that is no longer necessary to have regex support. - In addition to strings, regexes and object of the proposed shape, `additionalHooks` should also accept arrays of those values so that each one of them can be configured individually. The proposed object shape could also be extended to allow even more flexibility, like for example what the aforementioned Biome rule offers with its [`closureIndex` and `dependenciesIndex` options](https://biomejs.dev/linter/rules/use-exhaustive-dependencies/#validating-dependencies) (this would solve #25443), or with its [`stableResult` option](https://biomejs.dev/linter/rules/use-exhaustive-dependencies/#stable-results) (this would solve #16873)
open
aweebit
2025-06-01T18:25:25
2026-03-24T13:34:22
null
null
null
0
{ "heart": 1 }
7
false
2026-03-29T04:53:23.390740
facebook
react
34,769
I_kwDOAJy2Ks7QPFss
false
Bug: ViewTransition animations broken when using React Portal
When using React's `ViewTransition` component with `createPortal`, the view transition animations cause content that should be behind a modal dialog to appear on top of it during the transition. The background content (like buttons) becomes visible over the modal content, breaking the expected visual hierarchy. This issue does not occur when the same content is rendered without `createPortal` - the animations work smoothly and maintain proper visual layering. React version: 19.3.0-canary-3025aa39-20251007 ## Steps To Reproduce 1. Create a React component with `ViewTransition` wrapping the main content 2. Add a modal dialog that uses `createPortal` to render to `document.body` 3. Include a `startTransition` call when opening/closing the modal 4. Trigger the modal open/close action 5. Observe the layering issue during the view transition Link to code example: https://github.com/nikhilsnayak/view-transition-react-portal-bug https://codesandbox.io/p/sandbox/flamboyant-fire-fqz24d ```jsx import { ViewTransition } from 'react'; import { startTransition, Suspense, use, useState } from 'react'; import { createPortal } from 'react-dom'; export default function App() { const [isOpen, setIsOpen] = useState(false); return ( <ViewTransition> <div className='app-container'> <button className='open-button' onClick={() => { startTransition(() => { setIsOpen(true); }); }} > Click me </button> <Dialog isOpen={isOpen} setIsOpen={setIsOpen} /> </div> </ViewTransition> ); } function Dialog({ isOpen, setIsOpen }) { return ( isOpen && createPortal( <div className='overlay'> <div className='dialog'> <Suspense fallback={ <div className='skeleton-container'> <div className='skeleton'></div> <div className='skeleton'></div> <div className='skeleton'></div> <div className='skeleton'></div> </div> } > <DialogContent /> </Suspense> <button className='close-button' onClick={() => { startTransition(() => { setIsOpen(false); }); }} > Close </button> </div> </div>, document.body ) ); } const data = { name: 'John Doe', age: 30, email: 'john.doe@example.com', phone: '1234567890', address: '123 Main St, Anytown, USA', }; let promise = null; const getPromise = () => { if (promise) { return promise; } promise = new Promise((resolve) => setTimeout(() => resolve(data), 1000)); return promise; }; function DialogContent() { const resolved = use(getPromise()); return ( <div className='dialog-content'> <p className='dialog-title'>{resolved.name}</p> <p>{resolved.age}</p> <p>{resolved.email}</p> <p>{resolved.phone}</p> <p>{resolved.address}</p> </div> ); } ``` ## The current behavior When the modal dialog is opened/closed with `startTransition`, the view transition animation causes the background content (the button) to appear on top of the modal dialog during the transition. This creates a visual glitch where: 1. The modal backdrop appears correctly 2. The modal content gets rendered behind the button 3. The button becomes visible on top of the modal during the transition 4. After the transition completes, the visual hierarchy returns to normal The issue is particularly noticeable because: - The button should be behind the modal backdrop but appears on top - This only happens during the view transition animation - The problem occurs specifically when using `createPortal` to render the modal ## The expected behavior The modal dialog should maintain proper visual hierarchy throughout the view transition animation: 1. The modal backdrop should always be on top of the main content 2. The modal content should always be on top of the backdrop 3. The button should always be behind the modal backdrop 4. The visual hierarchy should be maintained during the entire transition The layering should work the same way as when `createPortal` is not used - smooth animations with proper visual hierarchy maintained throughout the transition. ## Additional Context - This issue occurs specifically when combining `ViewTransition` and `createPortal` - The same code works perfectly when the modal is rendered inline without `createPortal`
closed
not_planned
nikhilsnayak
2025-10-08T02:43:36
2026-03-24T15:28:16
2026-03-24T15:28:16
[ "Resolution: Stale", "Resolution: Expected Behavior" ]
null
0
{ "+1": 1 }
5
false
2026-03-29T04:53:25.017815
facebook
react
35,242
I_kwDOAJy2Ks7a-1Hh
false
Bug: `useActionState`'s second argument is not optional in the React types
React version: 19.2 ## Steps To Reproduce 1. `useActionState(action)` currently throws a type error. ## The current behavior I'm building a library that makes use of React Actions for mutations. There is no need to pass an initial state variable for `useActionState`. An "implicit undefined" initial state is perfectly fine and saves people from typing 6 characters each time. When I omit the second argument, React appears to be working just fine. However, `@types/react` expects the second argument to be provided. Can we make it optional or is there a reason to keep it required? ## The expected behavior `useActionState(action)` should not throw a type error. I submitted a PR for `@types/react` here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/74156
closed
not_planned
cpojer
2025-11-28T07:26:15
2026-03-07T03:42:30
2026-03-07T03:42:30
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{}
5
false
2026-03-29T04:53:19.617337
facebook
react
26,374
I_kwDOAJy2Ks5gk5aF
false
Bug: `createRoot` function from React@18 break the css `:target`
## Keywords - React 18 - createRoot - CSS selector - CSS Target - :target <!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> ## React version: React@18 ## Steps To Reproduce 1. open https://joyful-kelpie-c3bb20.netlify.app/buggy.html 2. click `go to react id target` link 3. You should see the `react id target` with green background 4. Refresh page. The green background disappears <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: The webpage source code is simple. You could check the source code directly. Or, you can check this: https://gist.github.com/magic-akari/475a13219394fb938cff4169a9b61eb7 <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior CSS target selector does not work. The green background disappears after refresh pages. ## The expected behavior CSS target selector should work after refresh pages. See: https://joyful-kelpie-c3bb20.netlify.app/ok.html
open
magic-akari
2023-03-12T08:53:51
2026-03-08T08:09:09
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 3 }
21
false
2026-03-29T04:53:19.660532
facebook
react
35,271
I_kwDOAJy2Ks7b189I
false
Bug: `progressiveChunkSize` forcing streaming SSR breaks html file integrity and `onAllReady` behavior
React version: 19.2.0 ## Steps To Reproduce ```tsx // App.tsx <div className="rp-doc rspress-doc"> <Suspense> <MyComp /> </Suspense> </div> ``` ```ts function renderToHtml(app: ReactNode): Promise<string> { return new Promise((resolve, reject) => { const passThrough = new PassThrough(); const { pipe } = renderToPipeableStream(app, { onError(error) { reject(error); }, onAllReady() { pipe(passThrough); text(passThrough).then(resolve, reject); }, }); }); } ``` related APIs: `renderToPipeableStream` `prerenderToNodeStream` etc ## react 19.1.1 ```html <main class="rp-doc-layout__doc-container"> <div class="rp-doc rspress-doc"> <h1>title</h1> </div> </main> ``` `.rspress-doc > h1` works fine ## react 19.2.0 If the article content is very long, it exceeds the chunkSize set by React. ```html <main class="rp-doc-layout__doc-container"> <div class="rp-doc rspress-doc"><!--$?--><template id="B:0"></template><!--/$--></div> </main> <script>requestAnimationFrame(function () { $RT = performance.now() });</script> <div hidden id="S:0"> <h1>title</h1> </div> ``` `.rspress-doc > h1` 🤕 ## Related links - https://github.com/web-infra-dev/rspress/pull/2831 - https://github.com/facebook/react/pull/33027 - https://github.com/facebook/react/pull/33027#issuecomment-3403958008 <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior `onAllReady` returns a HTML with streaming rendering ## The expected behavior `onAllReady` behavior as the same as React 19.1.1
closed
not_planned
SoonIter
2025-12-03T03:26:58
2026-03-10T05:23:35
2026-03-10T05:23:35
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "eyes": 2, "heart": 1 }
2
false
2026-03-29T04:53:19.800569
facebook
react
35,402
I_kwDOAJy2Ks7f6QDw
false
[DevTools Bug] Commit tree already contains fiber "536". This is a bug in React DevTools.
### Website or app none ### Repro steps 1:Clicking the right side to turn pages results in an error <img width="179" height="32" alt="Image" src="https://github.com/user-attachments/assets/f30325ef-665c-437b-b8c0-9f6903d91d1a" /> ### How often does this bug happen? Every time ### DevTools package (automated) react-devtools-extensions ### DevTools version (automated) 7.0.1-3cde211b0c ### Error message (automated) Commit tree already contains fiber "536". This is a bug in React DevTools. ### Error call stack (automated) ```text at updateTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:699600) at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:698832) at $e.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:703384) at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1005870) at renderWithHooks (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:66940) at updateFunctionComponent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:97513) at beginWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:111594) at performUnitOfWork (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184246) at workLoopSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:184102) at renderRootSync (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:183886) ``` ### Error component stack (automated) ```text at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1005671) at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:879909) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1144384 at ao (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:898411) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901313 at div (<anonymous>) at div (<anonymous>) at div (<anonymous>) at ThemeProvider (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:901116) at SuspenseTreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1147064) at InspectedElementContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:915935) at TimelineContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:994422) at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:986233) at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:786019) at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:815755) at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:972480) at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1175879) ``` ### GitHub query string (automated) ```text https://api.github.com/search/issues?q=Commit tree already contains fiber . This is a bug in React DevTools. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react ```
open
Rexjun01
2025-12-23T08:43:46
2026-03-09T03:51:30
null
[ "Type: Bug", "Status: Unconfirmed", "Component: Developer Tools" ]
[ "hoxyq" ]
0
{ "+1": 14, "heart": 3 }
4
false
2026-03-29T04:53:19.842764
facebook
react
35,243
I_kwDOAJy2Ks7bD1Ix
false
Bug: Should have a queue. This is likely a bug in React
<!-- I upgraded me react native app from 0.73.8 to 0.77.3 and as soon as I run app I get this error "Should have a queue. This is likely a bug in React. Please file an issue" --> React version: 18.3.1 ## Steps To Reproduce 1. Run react native app with RN 0.77.3 and react 18.3.1 2. First thing that shows is the error <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior App shows errors once it's built ## The expected behavior App should run without any errors
closed
not_planned
sindiAsx
2025-11-28T15:07:45
2026-03-09T10:19:32
2026-03-09T10:19:32
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "heart": 3 }
3
false
2026-03-29T04:53:19.882892
facebook
react
27,575
I_kwDOAJy2Ks500Mv9
false
UseEffect only works on localhost but not in production
UseEffect works normally on localhost but when I run the pipe and upload it to production it doesn't run and doesn't generate any errors. Package.json: ``` { "name": "ilitereport", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "export": "next export", "lint": "next lint", "lint:fix": "eslint --fix" }, "dependencies": { "@remix-run/router": "^1.6.3", "@types/node": "20.3.1", "@types/react": "18.2.13", "@types/react-dom": "18.2.6", "bootstrap": "^5.3.0", "eslint-config-next": "13.4.6", "next": "^13.4.10-canary.6", "react": "18.2.0", "react-bootstrap": "^2.7.4", "react-dom": "18.2.0", "use-effect-x": "^0.1.5" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.60.0", "@typescript-eslint/parser": "^5.60.0", "eslint": "^8.43.0", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-n": "^15.7.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react": "^7.32.2", "prettier": "^2.8.8", "sass": "^1.63.5", "typescript": "^5.1.3" } } ``` ## Steps To Reproduce ``` "use client"; import React from "react"; import Image from 'next/image' export default function InvoiceCAR(props: any) { const [dataExpiracao, setDataExpericacao] = React.useState(''); const [subTotal, setSubTotal] = React.useState(0); const [desconto, setDesconto] = React.useState(0); const [total, setTotal] = React.useState(0); async function render() { console.log(props) try { const dataFormatada = await formatarDataString(); setDataExpericacao(dataFormatada); } catch (error) { console.error("Erro ao formatar a data:", error); } let subTotal = 0; let desconto = 0; let total = 0; props.order.orderProducts?.map((order: any) => { subTotal += (order.productPrice * order.quantity); desconto += (order.productDiscount * order.quantity); total = (subTotal - desconto); setSubTotal(subTotal); setDesconto(desconto); setTotal(total); }) } React.useEffect(() => { render(); }, []) async function formatarDataString<T>() { const data = String(await props.order.dateExpire); if (typeof data !== "string") { return "Data inválida"; } const partes = data?.split('T'); if (!partes || partes.length < 2) { return "Data inválida"; } const [dataParte, horaParte] = partes; const dataComponentes = dataParte.split('-'); if (!horaParte) { return "Hora inválida"; } const horaComponentes = horaParte.split(':'); const [ano, mes, dia] = dataComponentes; const [horas, minutos] = horaComponentes; const dataFormatada = `${dia}/${mes}/${ano} ${horas}:${minutos}`; return dataFormatada; } return ( <> <title>{`Orçamento - ${props.order.number} - ${props.order.personClientName}`}</title> <meta name="description" content={`Seu orçamento está disponível neste link, no valor total de R$ ${total}. `} /> <meta property="og:image" content={props.order.businessLogo} /> <meta property="og:title" content={`Orçamento - ${props.order.number} - ${props.order.personClientName}`} /> <meta property="og:url" content="https://report.ilite.com.br/" /> <meta property="og:site_name" content={`Ilite ERP 360`} /> <meta property="og:type" content="website" /> <meta property="og:description" content={`Seu orçamento está ${props.order.personClientName}, valor total é R$ ${total}. `} /> <div className="container-fluid mt-6 mb-7" style={{minWidth: '900px'}}> <div className="row justify-content-center"> <div className="col-lg-12 col-xl-10"> <div className="card"> <div className="card-body p-5"> <div className="row"> <div className="col-md-12 divLogo d-flex justify-content-start align-items-center mb-5"> <img src={props.order.businessLogo} style={{maxWidth: "150px", width: "100%", height: "auto"}} alt={"ilite logo"} /> </div> <div className="col-md-12"> <h2 className="text-left"> {props.order.businessName} </h2> <div className="text-muted mb-2">Dados da empresa</div> <strong> {props.order.businessCnpjCpf?.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, "$1.$2.$3/$4-$5")} </strong> <p className="fs-sm"> {props.order.businessAddressCity}{props.order.businessAddressCity && ','} {props.order.businessAddressState} <br /> {props.order.businessAddressStreet} {props.order.businessAddressNumber} {props.order.businessAddressStreet && ','} {props.order.businessAddressDistrict} <br /> {props.order.businessAddressZipCode?.replace(/(\d{5})(\d{2})/, "$1-$2")} </p> </div> </div> <div className="border-top border-gray-200 pt-4 mt-4"> <div className="row"> <div className="col-md-6"> <div className="text-muted mb-2">Número</div> <strong># {props.order.number}</strong> </div> <div className="col-md-6 text-md-end"> <div className="text-muted mb-2">Expiração</div> <strong>{dataExpiracao}</strong> </div> </div> </div> <div className="border-top border-gray-200 mt-4 py-4"> <div className="row"> <div className="col-md-4"> <div className="text-muted mb-2">Cliente</div> <strong> {props.order.personClientName} </strong> <p className="fs-sm"> {props.order.personClientCnpjCpf?.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4")} <br /> </p> </div> <div className="col-md-4"> <div className="text-muted mb-2">Dados do carro</div> <strong> {props.order.model} </strong> <p className="fs-sm"> Descrição: {props.order.description} </p> </div> </div> </div> <table className="table table-striped"> <thead> <tr> <th scope="col" className="fs-sm text-dark text-uppercase-bold-sm px-0">Descrição</th> <th scope="col" className="fs-sm text-dark text-uppercase-bold-sm px-0">Quantidade</th> <th scope="col" className="fs-sm text-dark text-uppercase-bold-sm text-end px-0">quantia</th> </tr> </thead> <tbody> {props.order.orderProducts?.map((order: any) => { return ( <tr key={order.productName}> <td className="px-0">{order.productName}</td> <td className="px-0">{order.quantity}</td> <td className="text-end px-0">R$ {order.productPrice}</td> </tr> ) })} </tbody> </table> <table className="table table-striped"> <thead> <tr> <th style={{width: "300px"}} scope="col" className="fs-sm text-dark text-uppercase-bold-sm px-0">Imagem</th> <th scope="col" className="fs-sm text-dark text-uppercase-bold-sm px-0">Descrição</th> </tr> </thead> <tbody> {props.order.orderMedias?.map((media: any) => { return ( <tr key={media.name}> <td style={{textAlign: "center"}} className="px-0"> {/* {media.name} */} <img style={{objectFit: "cover", maxWidth: "200px"}} src={`https://cdn.ilite.com.br/${media.businessUid}/${media.name}`} /> </td> <td className="px-0"> {media.description} </td> </tr> ) })} </tbody> </table> <div className="border-top border-gray-200 mt-4 py-4"> <div className="row"> <div className="col-md-12"> <b className="text-danger">{props.order.businessFooterMessage}</b> </div> </div> </div> <div className="mt-5"> <div className="d-flex justify-content-end"> <p className="text-muted me-3">Subtotal:</p> <span>R${subTotal}</span> </div> <div className="d-flex justify-content-end"> <p className="text-muted me-3">Desconto:</p> <span>-R${desconto}</span> </div> <div className="d-flex justify-content-end mt-3"> <h5 className="me-3">Total:</h5> <h5 className="text-success">R${total}</h5> </div> </div> </div> </div> </div> </div> </div> </> ); } ``` ## The current behavior UseEffect is only working in the development environment ## The expected behavior UseEffect work in production
closed
completed
fbgrigolo
2023-10-24T18:30:23
2026-03-11T09:14:12
2023-10-30T06:15:37
[ "Status: Unconfirmed" ]
null
0
{}
2
false
2026-03-29T04:53:19.930004
facebook
react
19,150
MDU6SXNzdWU2NDA4OTQ2OTc=
false
Proposition about onInput/onChange
Hi :) In ReactDom we can find: ``` javascript function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) { if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) { return getInstIfValueChanged(targetInst); } } ``` Why not adding an extra condition here like: ``` javascript function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) { if ((!React.$$useRealOnChange && topLevelType === TOP_INPUT) || topLevelType === TOP_CHANGE) { return getInstIfValueChanged(targetInst); } } ``` By checking `React.$$useRealOnChange` in this function, a user could add this line: ``` javascript React.$$useRealOnChange = true; ``` anywhere in their code (before or after including ReactDom) to find back the more native behavior. I'm sorry in advance if this proposition has already been proposed
open
mr21
2020-06-18T04:20:35
2026-03-08T19:08:36
null
[ "Status: Unconfirmed" ]
null
0
{ "+1": 7, "eyes": 3 }
33
false
2026-03-29T04:53:20.042107
facebook
react
24,430
I_kwDOAJy2Ks5IVJtv
false
Bug: Hydration mismatch error due to plugins generating script tag on top
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 18.0.0, 18.1.0-next-fc47cb1b6-20220404 (latest version in codesandbox) ## Steps To Reproduce 1. Install a plugin that creates a script tag at the top(ex: [Apollo Client Devtools](https://chrome.google.com/webstore/detail/apollo-client-devtools/jdkknkkbebbapilgoeccciglkfbmbnfm)) 2. Go to the [demo](https://codesandbox.io/s/kind-sammet-j56ro?file=/src/App.js) in the [new SSR suspense guide](https://github.com/reactwg/react-18/discussions/37) 3. Open preview in a new window 4. UI mismatch error occurs at hydration time <img width="600" alt="스크린샷 2022-04-24 오전 11 02 34" src="https://user-images.githubusercontent.com/4126644/164952677-06618e72-3343-4b92-9eaa-b45bce11c3ab.png"> <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/s/kind-sammet-j56ro?file=/src/App.js <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior If a script tag is inserted before the head tag due to the user's browser environment such as a plugin, it is judged as a hydration mismatch and the screen is broken. https://user-images.githubusercontent.com/4126644/164953071-14546c74-d9ab-4a6f-8f99-6712f29c6dd6.mov ## The expected behavior This problem may be a part that each third party needs to solve, but I'm wondering if it's possible to handle an exception in the hydration matching logic of React.
open
yongdamsh
2022-04-24T02:16:30
2026-03-08T18:46:14
null
[ "Component: Server Rendering", "Resolution: Backlog" ]
[ "gnoff" ]
0
{ "+1": 104, "rocket": 2 }
91
false
2026-03-29T04:53:20.155534
facebook
react
34,770
I_kwDOAJy2Ks7QP_8b
false
Bug: Massive memory allocations using React dev build under frequent updates (prod build unaffected)
React dev build has a memory issue where under frequent updates memory footprint grows from ~100 MB to 1 GB within 5 minutes in a simple reproduction app. The JS heap remains stable at ~50 MB. Production builds are unaffected. Or I might have introduced a bug which is reproducible in dev only. ## Reproduce 1. Run: https://github.com/dokugo/react-dev-memory-leak This repo replicates behavior I have in one of my apps. It's a virtualized table with 400 rows and 10 cols. Every second the last row is removed and one new row is prepended. Also a random 50% of total cells are updated and re-rendered (increased the amount for faster reproduction). 2. Do nothing and wait a few minutes, see "memory footprint" in Chrome task manager, or "memory" in Firefox about:processes grow from ~100MB to 1GB in a few minutes, while actual JS memory heap stays lean and stable. 3. While app is running: Chrome DevTools > Memory > Allocation instrumentation on timeline (Allocation stack traces checked). Allocation timeline points to React internals, probaby their allocations aren't promptly GC'd. Perhaps some dev mode instrumentation? Or maybe has something to do with detached nodes? 4. See top offenders (all from react-dom-client.development.js). Data from the screenshot below: - addValueToProperties > addObjectDiffToProperties: 20 million objects allocated, +610MB - logComponentRender > commitPassiveMountOnFiber, recursivelyTraversePassiveMountEffects: 3.9M obj, 186MB - repeat > addValueToProperties > addObjectDiffToProperties: 8.9M obj, 156MB All of them showing tiny Live Size, but the actual memory footprint of the tab actively grows with them allocating more, until we hit OOM. Screenshot and profile of what happens in 5 min of running dev server: https://drive.proton.me/urls/300AVT1D3R#obxPg3RRxZQE <img width="1173" height="572" alt="Image" src="https://github.com/user-attachments/assets/a403c96c-8c15-4446-b7e2-fbd8ccc50699" /> Screenshot and profile of memory allocations over 5 minutes for the `PlainTable` variation (incognito, no extensions): https://drive.proton.me/urls/M75DRSHMWM#6kCT7t1TazyP ![Image](https://github.com/user-attachments/assets/eb520412-4dc1-42df-b199-7e0e18b21a0b) Notes: - I use React Compiler with a bit of manual memoization, using fully manual memoization still reproduces the bug - Reproduces using `PlainTable.tsx` (no TanStack Table and Virtualizer) - Reproduces with disabled React Scan and React DevTools - Reproduces with and without StrictMode - Reproduces in incognito with extensions disabled and DevTools closed - Production build works without issues - React 19.2.0 with Vite - In my app I have 2 tables with sometimes 1000+ rows in each one (with 15-20 cols), consuming 100-1000 WebSocket updates per second, batching them and applying mutation to TanStack Query cache once per second. Memory allocation grows from 300MB to 3GB unacceptably fast, making development difficult. Yet in production no issues, small and stable memory footprint, no lags, while my cells have a lot inside them, including frequent animations, images...
closed
completed
dokugo
2025-10-08T05:09:16
2026-03-10T11:21:32
2025-10-13T21:42:15
[ "Status: Unconfirmed" ]
[ "hoxyq" ]
0
{ "+1": 1, "heart": 1 }
18
false
2026-03-29T04:53:20.208840
facebook
react
34,349
I_kwDOAJy2Ks7I0eMZ
false
[Enhancement] Add option to prevent fallback to client-side execution when using `use()`
> Note: **SORRY IF I CREATED USING BUG REPORT TEMPLATE, PLEASE CORRECT ME THE TEMPLATE I SHOULD USE IF I AM WRONG, because I can't find a template named "Feature Request" :(((** > **Issue Type:** Enhancement / Feature Request Currently, when using `use()` in React server components, if a server-side action fails or is unavailable, it may fall back to executing on the client side. I propose adding a parameter or option that allows developers to **disallow this fallback**, ensuring that certain actions always remain server-only. This would be useful in scenarios where: * Sensitive operations must never execute on the client. * Server-specific resources or data are required. * Consistency and security need to be enforced. **Proposed Behavior:** * Add a boolean parameter (e.g., `allowClientFallback = true`) to `use()`. * When set to `false`, `use()` should throw an error if the server action is unavailable, instead of falling back to client-side execution. **Example:** ```js const data = use(fetchServerData, { allowClientFallback: false }); ``` **Benefits:** * Prevent accidental execution of server-only logic on the client. * Improve security and predictability of server components. * Give developers explicit control over fallback behavior.
closed
not_planned
vuthanhtrung2010
2025-08-30T14:55:26
2026-03-11T06:20:46
2026-03-11T06:20:46
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "heart": 1 }
4
false
2026-03-29T04:53:20.246879
facebook
react
15,137
MDU6SXNzdWU0MjIxNjQ2MzI=
false
Suspense throwing before first render, leading to useMemo not working correctly
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** The `useMemo` callback is called twice if Suspense throws a promise before the first render. Same with the `useState` lazy initializer **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** See https://codesandbox.io/s/oj3q9yv2jz?expanddevtools=1&fontsize=14. If you check the console, it should only be called once but instead it's called twice. **What is the expected behavior?** `useMemo` should only evaluate the function on the first render, if the dependency array is empty. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.8.3, haven't tested previous versions
closed
completed
samdenty
2019-03-18T11:19:32
2026-03-11T17:35:21
2019-03-18T11:56:48
null
null
0
{ "+1": 1 }
4
false
2026-03-29T04:53:20.332567
facebook
react
34,307
I_kwDOAJy2Ks7IGHRl
false
Bug: re-ordering components with stable keys invalidates refs/state, since 19.0.0
I've tested with 18.3.1, 19.0.0, and 19.1.1. I build a modular synth application which uses the Web Audio API. Since it's possible for synth patches to grow quite large, I memoize the ordered list of modules for the sake of having a sensible keyboard navigation order. This means that the order of rendered modules can change. Up until React 18.3.1, this changing order of rendered modules was not causing any issues. I make sure to use stable unique identifiers as keys when rendering, so components' internal state remains stable as the modules are dragged around the canvas. Here's a snippet of the code used to render the modules: ```tsx const sortedModules = useMemo( () => { // ... order the modules based on their positions in the canvas }), [state.modulePositions, state.modules], ); return ( <> {sortedModules.map(([module, position]) => ( <Module key={module.moduleKey} module={module} position={position} state={state} dispatch={dispatch} /> ))} </> ); ``` Internally, `<Module />` calls a hook which stores a ref to a "node" object – which acts as its handle into the audio API – and initializes it like so: ```typescript // ... const nodeRef = useRef<NodeType>(undefined); if (!nodeRef.current) { nodeRef.current = nodeFactory(); } // ... ``` So, since React 19.0.0, this ref seems to get out of sync when the order of the rendered components changes. React version: 19.0.0, 19.1.1 ## Steps To Reproduce 1. `git clone https://github.com/rain-sk/synth.kitchen.git && cd synth.kitchen` 2. `git checkout demo-react19-issues` 3. `cd app/web` 4. `npm i && npm run dev` 5. Visit localhost:8080 and press "start" 6. Double-click in the center of the screen, then choose one of the options in the menu to add a new module to the canvas 7. Drag the output module to the bottom-right corner of the screen, past the newly-added module Expected: - internal module state is stable regardless of render order Result: - hit the debugger line in the `useNode` hook, indicating that the ref was reset, even though we've already initialized the corresponding node Note: the commit behind the HEAD of `demo-react19-issues` is the one which adds the debugger statement. Switching to that commit (`b8f76f9f845328a6e83fdd3a13981f82cf16fe11`) and re-installing node_modules, demonstrates that this problem did not exist prior to React 19. Link to code example: ## The current behavior Changing render order of components with stable keys results in broken internal refs. ## The expected behavior Internal refs of react components are stable regardless of render order, given stable key props.
closed
not_planned
rain-sk
2025-08-26T20:32:55
2026-03-11T14:29:45
2026-03-11T06:20:48
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{}
10
false
2026-03-29T04:53:20.404805
facebook
react
13,991
MDU6SXNzdWUzNzQ1ODc1ODk=
false
Hooks + multiple instances of React
# To people coming from search: please [read this page first](https://reactjs.org/warnings/invalid-hook-call-warning.html). It contains most common possible fixes! **Do you want to request a *feature* or report a *bug*?** Enhancement **What is the current behavior?** I had multiple instances of React by mistake. When trying to use hooks, got this error: `hooks can only be called inside the body of a function component` Which is not correct since I was using function components. Took me a while to find the real cause of the issue. **What is the expected behavior?** Show the correct error message. Maybe detect that the app has multiple instances of React and say that it may be the reason of bugs.
open
brunolemos
2018-10-27T00:34:08
2026-03-06T20:26:47
null
[ "Type: Discussion", "Component: Hooks" ]
null
0
{ "+1": 291, "-1": 1, "confused": 5, "eyes": 30, "heart": 21, "hooray": 2, "rocket": 32 }
515
false
2026-03-29T04:53:20.458958
facebook
react
34,840
I_kwDOAJy2Ks7RXJ3i
false
Bug: `react-dom-client.development.js` tries to read `$$typeof` on iframe object
In `ReactFiberPerformanceTrack` it tries to deep read the props in DEV mode, `props` may deeply contains `cross-origin frame` which will cause `SecurityError: Failed to read a named property '$$typeof' from 'Window': Blocked a frame with origin "http://localhost:8080/" from accessing a cross-origin frame.` React version: 19.2.0 (I believe the change is introduced in #30967) ## Steps To Reproduce there are three factors caused this problem 1. deep in props there is a reference to host `window` or `document` object 2. google reCAPTCHA is in use. it mounts a iframe and inject the iframe reference to `document` <img width="1265" height="752" alt="Image" src="https://github.com/user-attachments/assets/35925e7e-5e83-48e0-9328-fffa7c266360" /> 3. react 19.2.0 tries to recursively read props object and access `.$$typeof` ## The current behavior Throwing error ## The expected behavior Not to throw error
closed
completed
jzhan-canva
2025-10-14T06:12:50
2026-03-11T15:35:12
2026-02-03T16:53:47
[ "Status: Unconfirmed" ]
null
0
{ "+1": 1, "heart": 8 }
5
false
2026-03-29T04:53:20.506538
facebook
react
32,715
I_kwDOAJy2Ks6vUxci
false
Bug: `renderToStaticMarkup` throws error on client components
React version: 19.0.0 ## Steps To Reproduce 1. Create a client component with the `'use client'` directive. 2. Create a server (universal) component that uses the client component. 3. Call `renderToStaticMarkup` with the server component. Link to code example: https://codesandbox.io/p/devbox/keen-williamson-wg9p8w (using Next.js to demonstrate `'use client'`) ## The current behavior `renderToStaticMarkup` throws an `Error` when it encounters a client component: > Error: Attempted to call MyClientComponent() from the server but MyClientComponent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component. ## The expected behavior When `renderToStaticMarkup` encounters a client component, it renders non-interactive HTML for the component, just as pre-rendering would during SSR.
closed
not_planned
jonathanhefner
2025-03-23T20:12:07
2026-03-12T03:02:47
2026-03-12T03:02:47
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "+1": 1 }
7
false
2026-03-29T04:53:20.561393
facebook
react
31,600
I_kwDOAJy2Ks6fkIos
false
[React 19] Regression when using `createPortal` with DOM element created by `dangerouslySetInnerHTML`
In React 18, it was possible to use `createPortal` with a DOM element created by `dangerouslySetInnerHTML`. Example (adapted from [this Stack Overflow answer](https://stackoverflow.com/questions/62300569/add-react-component-in-html-set-by-dangerouslysetinnerhtml/77099814#77099814)): ```tsx import { useCallback, useState } from "react"; import { createPortal } from "react-dom"; export default function App() { const htmlFromElsewhere = `foo <span class="portal-container"></span> bar`; return <InnerHtmlWithPortals html={htmlFromElsewhere} /> } function InnerHtmlWithPortals({ html }: { html: string }) { const [portalContainer, setPortalContainer] = useState<Element | null>(null) const refCallback = useCallback((el: HTMLDivElement) => { setPortalContainer(el?.querySelector(".portal-container")) }) return <> <div ref={refCallback} dangerouslySetInnerHTML={{ __html: html }} /> {portalContainer && createPortal(<Cake />, portalContainer)} </> } function Cake() { return <strong>cake</strong> } ``` React 18 CodeSandbox: https://codesandbox.io/p/sandbox/optimistic-kowalevski-73sk5w In React 19, this no longer works. React appears to be re-rendering the inner HTML after calling `refCallback`. Thus, `createPortal` succeeds, but the `portalContainer` element that it uses is no longer part of the DOM. React 19 CodeSandbox: https://codesandbox.io/p/sandbox/vibrant-cloud-gd8yzr It is possible to work around the issue by setting `innerHTML` directly instead of using `dangerouslySetInnerHTML`: ```diff const [portalContainer, setPortalContainer] = useState<Element | null>(null) const refCallback = useCallback((el: HTMLDivElement) => { + if (el) el.innerHTML = html setPortalContainer(el?.querySelector(".portal-container")) - }) + }, [html]) return <> - <div ref={refCallback} dangerouslySetInnerHTML={{ __html: html }} /> + <div ref={refCallback} /> {portalContainer && createPortal(<Cake />, portalContainer)} </> ``` But I'm not sure whether that is a reliable solution.
closed
not_planned
jonathanhefner
2024-11-20T20:12:39
2026-03-11T23:07:55
2026-03-11T23:07:55
[ "Resolution: Stale", "React 19" ]
null
0
{ "+1": 3, "eyes": 1 }
10
false
2026-03-29T04:53:20.625263
facebook
react
35,480
I_kwDOAJy2Ks7idZDu
false
Bug: Infinite loop in event listener during DOM traversal caused by nested <body> tags
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> ## summary React v19 freezes the browser (99% CPU) via an infinite event loop when focusing input elements inside nested body tags. Unlike React v15, which remained stable under the same malformed structure, the modern version fails to handle this DOM desynchronization, showing a significant decline in fault tolerance. React version: 19.2.0 ## Steps To Reproduce 1. Create a new React application using Vite or Create React App (CRA). 2. Replace the contents of main.tsx (Vite) or index.tsx (CRA) with the reproduction code provided below. 3. Run the application in development mode (e.g., npm run dev) or build and serve the production build. 4. Open the application in a browser (Chrome or Firefox) and focus on the input or textarea element. 5. Observe that an infinite loop is triggered immediately upon focus, causing the browser tab to hang or freeze completely. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ``` import { createRoot } from "react-dom/client"; createRoot(document.getElementById("root")!).render( <body> <input type="text" /> </body> ); ``` ## The current behavior Problem Scenario: Invalid HTML Generation: Writing a body tag inside a React component generates HTML with nested body tags after the build process. Browser DOM Normalization: When executed, the browser detects the invalid nesting and modifies the DOM structure (typically removing the nested body or moving its children) to comply with HTML standards. JS-DOM Desynchronization: The compiled React JavaScript code maintains a reference to the body element inside the root, which no longer exists in its expected location due to browser normalization. Event Interception: When an input or textarea element within this malformed zone is focused, React’s internal event system intercepts the interaction. Infinite Traversal Loop: It appears that the event listener enters a for(;;) loop while traversing the tree to find the target or its ancestors. Since the DOM tree has been "mutated" by the browser's parser, the loop never hits its termination condition, hijacking the Event Loop and freezing the browser tab (100% CPU usage). <img width="1374" height="752" alt="Image" src="https://github.com/user-attachments/assets/327091e0-5554-4c4d-9cf1-b6dad903b572" /> It appears that in the past, despite being an unconventional and 'incorrect' method, React v15's tolerance for nesting <body> tags within the DOM effectively prevented this critical issue. By allowing the malformed structure to persist rather than repeatedly attempting to 'fix' it, the browser was able to avoid the recursive rendering conflict that now leads to a total system freeze. While nesting <body> tags is invalid HTML, the shift from a 'malformed UI' in v15 to a 'system-wide freeze' in v18 feels like an unintended side effect on the framework's resilience. ## The expected behavior Implement Iteration Limits and Explicit Error Reporting: Set a maximum iteration count within React's event traversal logic to prevent synchronous infinite loops. Crucially, if the search limit is exceeded or the target element cannot be resolved, React should throw an explicit runtime error. This ensures that the framework fails gracefully and provides immediate feedback to the developer, rather than hanging the UI thread silently. Build-time Validation: Adjust the React compiler or associated build tools to trigger a build-time error when body tags are nested inappropriately within the component tree. Impact: This is a "Silent Crash" bug that renders the debugging experience extremely difficult. By replacing a terminal browser hang with a clear runtime error, we can significantly enhance the Runtime Robustness and Developer Experience (DX) of the React ecosystem.
open
gsilver7
2026-01-10T08:49:26
2026-03-13T09:22:21
null
[ "Status: Unconfirmed" ]
null
0
{ "eyes": 1 }
1
false
2026-03-29T04:53:20.718232
facebook
react
35,225
I_kwDOAJy2Ks7amvsk
false
Bug: Erro: Falha ao executar 'insertBefore' em 'Node': O nó antes do qual o novo nó deve ser inserido não é filho deste nó.
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
closed
not_planned
Raugusto79
2025-11-26T13:44:17
2026-03-12T16:19:18
2026-03-12T14:21:09
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "heart": 1 }
5
false
2026-03-29T04:53:20.756105
facebook
react
31,529
I_kwDOAJy2Ks6ePQsm
false
Bug: Images with `loading="lazy"` remounted with react are all loaded
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 18.3.1 ## Steps To Reproduce Open DevTools Network tab and check "disable cache" to see how much data is requested. 1. Render a long list of `<img>` tags with `loading="lazy"` (placed after the `src` attribute) 2. (only a few top images are loaded, you can see max few hundred kb downloaded) 3. Unrender the list 4. Render the list again 5. (all of them are requested, you can see many mb being downloaded) <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/p/sandbox/react-18-forked-2f9q8l?workspaceId=1b03e581-57eb-43f2-80b8-0d9e38ede5b5 (additional explanation below) <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Under certain circumstances, all the images are loaded when remounted with React, despite `loading="lazy"` being specified. The example code above, provides two ways in which the images are removed from DOM and then added again: one using react state, and the other using simple native DOM methods. Turns out that only when React renders the list (and only when it's done for the second+ time), the lazy loading is broken. With DOM methods, you can remount the images many times and every time only few top images are loaded. There's also a button to switch the position of `loading="lazy"` attribute to be before or after `src=`. It shows that order makes difference and issue occurs only when the `loading` attribute is placed after `src`. There used to be a bug in Firefox that caused the lazy loading to not work when loading attribute is placed after src, but it is gone and was never a problem in Chrome. Yet, somehow, the way in which React adds the nodes to DOM, reproduces the bug even in Chrome. I am personally experiencing it in Chrome version 131.0.6778.70 (64bit, windows). ## The expected behavior No matter the order of attributes, the behavior should be as per the standard browser behavior. It shouldn't matter that it's React appending the nodes or which time it's doing it.
closed
not_planned
aczekajski
2024-11-13T09:23:41
2026-03-12T16:26:07
2026-03-12T16:26:07
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "+1": 1 }
10
false
2026-03-29T04:53:20.804492
facebook
react
36,039
I_kwDOAJy2Ks7y2Qwg
false
Bug:
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: ## Steps To Reproduce 1. 2. <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior ## The expected behavior
closed
completed
skywalker8888
2026-03-14T02:02:15
2026-03-14T02:07:32
2026-03-14T02:07:32
[ "Status: Unconfirmed" ]
null
0
{}
0
false
2026-03-29T04:53:20.850083
facebook
react
31,906
I_kwDOAJy2Ks6kavP-
false
Bug: source maps are missing from react npm packages
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19.0.0, applicable to lower versions ## Steps To Reproduce Install react npm package <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Source maps is missing ## The expected behavior Source maps should be generated and present
closed
not_planned
asvishnyakov
2024-12-25T04:10:50
2026-03-13T09:18:19
2026-03-13T01:36:44
[ "Status: Unconfirmed", "Resolution: Stale" ]
null
0
{ "+1": 1 }
18
false
2026-03-29T04:53:20.881539
facebook
react
35,034
I_kwDOAJy2Ks7VZtvr
false
Bug: useEffectEvent having different behaviors when used with memo and without memo
<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --> React version: 19.2.0 ## Steps To Reproduce 1. Wrap components with memo <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --> Link to code example: https://codesandbox.io/p/sandbox/damp-dust-skq4hf <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior Having different behaviors ![Image](https://github.com/user-attachments/assets/9e1814e5-3fa5-407e-afc1-52d874b80084) ## The expected behavior Having the same behavior
closed
not_planned
nuintun
2025-11-03T01:59:31
2026-03-12T16:23:11
2026-03-12T03:02:44
[ "Type: Bug", "Component: Reconciler" ]
null
0
{ "+1": 3 }
8
false
2026-03-29T04:53:20.926610