Proto
Collection
I really don't like this dataset
•
3 items
•
Updated
Error code: DatasetGenerationCastError Exception: DatasetGenerationCastError Message: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 1 new columns ({'merged_at'}) and 2 missing columns ({'comments_count', 'labels'}). This happened while the json dataset builder was generating data using hf://datasets/FlameF0X/Proto-2.1/github_pull_requests_2025-04-18T16-38-21.338Z.json (at revision f5752dcb23f689b9114c46653eefd1ccdba0498c) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations) Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1871, in _prepare_split_single writer.write_table(table) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 623, in write_table pa_table = table_cast(pa_table, self._schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2293, in table_cast return cast_table_to_schema(table, schema) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2241, in cast_table_to_schema raise CastError( datasets.table.CastError: Couldn't cast repo: string number: int64 title: string state: string user: string body: string created_at: timestamp[ns, tz=UTC] updated_at: timestamp[ns, tz=UTC] merged_at: timestamp[ns, tz=UTC] comments: list<item: null> child 0, item: null -- schema metadata -- pandas: '{"index_columns": [], "column_indexes": [], "columns": [{"name":' + 1341 to {'repo': Value(dtype='string', id=None), 'number': Value(dtype='int64', id=None), 'title': Value(dtype='string', id=None), 'state': Value(dtype='string', id=None), 'user': Value(dtype='string', id=None), 'body': Value(dtype='string', id=None), 'comments_count': Value(dtype='int64', id=None), 'created_at': Value(dtype='timestamp[ns, tz=UTC]', id=None), 'updated_at': Value(dtype='timestamp[ns, tz=UTC]', id=None), 'labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'comments': [{'body': Value(dtype='string', id=None), 'created_at': Value(dtype='string', id=None), 'id': Value(dtype='int64', id=None), 'updated_at': Value(dtype='string', id=None), 'user': Value(dtype='string', id=None)}]} because column names don't match During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1438, in compute_config_parquet_and_info_response parquet_operations = convert_to_parquet(builder) File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1050, in convert_to_parquet builder.download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 925, in download_and_prepare self._download_and_prepare( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1001, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1742, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1873, in _prepare_split_single raise DatasetGenerationCastError.from_cast_error( datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset All the data files must have the same columns, but at some point there are 1 new columns ({'merged_at'}) and 2 missing columns ({'comments_count', 'labels'}). This happened while the json dataset builder was generating data using hf://datasets/FlameF0X/Proto-2.1/github_pull_requests_2025-04-18T16-38-21.338Z.json (at revision f5752dcb23f689b9114c46653eefd1ccdba0498c) Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
repo
string | number
int64 | title
string | state
string | user
string | body
string | comments_count
int64 | created_at
timestamp[us, tz=UTC] | updated_at
timestamp[us, tz=UTC] | labels
sequence | comments
list |
---|---|---|---|---|---|---|---|---|---|---|
facebook/react | 32,961 | Feature Request: allow for DOM mode insertion in createPortal | open | lucassardois | <!--
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.
-->
I know this is more of a feature request than a bug, but I did not find where to send feature request, so here it is:
React version: 18+
## Steps To Reproduce
1. Use `createPortal`
2. I would except `createPortal` to have the abilitty to insert node before, after etc. the passed element.
My use case is inserting React apps into a DOM I do not control from a web extension. The DOM placement matters.
<!--
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
It only append element to the DOM.
## The expected behavior
It can append element or insert before the provided DOM element.
| 0 | 2025-04-18T14:20:27 | 2025-04-18T14:21:24 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,960 | Feature Request: add useEffect callback argument | open | cgx-system | This is not a bug, but I didn't find any other place to ask for new features. Sorry if it bothers you.
It would be really useful to pass an argument to a useEffect callback and get an array of the dependencies that triggered the effect, eventualy with their previous values. Something like that :
```
useEffect(prev => {
console.log(prev)
}, [dep1, dep2, dep3]
//=> [ { name: 'dep1', prevValue: <value> }, { name: 'dep3', prevValue: <value>} ]
```
If there is a better existing way to achieve the same thing, please tell me. | 2 | 2025-04-18T11:32:48 | 2025-04-18T14:19:27 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi there! I understand that you'd like to track the previous values of dependencies in useEffect. While React doesn’t support this functionality directly, you can achieve this by using a custom hook. Here's a simple implementation that might help:\n\n```\nimport { useRef, useEffect } from 'react';\n\nfunction usePreviousValue(dep) {\n const prevRef = useRef();\n useEffect(() => {\n prevRef.current = dep;\n }, [dep]);\n return prevRef.current;\n}\n```\n\nThis custom hook will allow you to track the previous values of dependencies like dep1, dep2, etc. Feel free to give it a try!",
"created_at": "2025-04-18T13:46:43Z",
"id": 2815482416,
"updated_at": "2025-04-18T13:46:43Z",
"user": "Axhataaa"
},
{
"body": "Thanks a lot for this trick. It allows to keep track of the previous dependency value, but what if I want to know which dependency triggered the effect ? I could compare all the dependencies with their previous values, but it could greatly impact code readability and performances with complex objects !\n\nI couldn't find where the useEffect hook is defined in React code, but I guess it is already doing this comparison before triggering the effect, so it could just pass it to the callback.\n\nBy the way, I'm surprised that this has not already been done...",
"created_at": "2025-04-18T14:19:26Z",
"id": 2815540755,
"updated_at": "2025-04-18T14:19:26Z",
"user": "cgx-system"
}
] |
facebook/react | 32,956 | . | closed | ghost | . | 0 | 2025-04-18T06:24:24 | 2025-04-18T06:26:24 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,955 | Vanessa Hudgens | closed | ghost | # Vanessa Hudgens Nude (19.38 GB MEGA) Folder #B0LyS
## [🔗👉👉 Click And Watch Vanessa Hudgens! 🔗](https://dar.vin/tommis)
[](https://dar.vin/tommis) | 0 | 2025-04-18T05:30:26 | 2025-04-18T05:30:29 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,954 | Bug: React 19.0.0 upgraded to 19.1.0, renderToPipeableStream Suspense fallback does not return the first fragment content | open | 10086XIAOZHANG | <!--
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
| 0 | 2025-04-18T03:30:23 | 2025-04-18T03:30:23 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,950 | [Compiler Bug]: Coverage report shows missing branch coverage | open | ValentinGurkov | ### 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.0.0-beta-ebf51a3-20250411 | 0 | 2025-04-17T09:00:56 | 2025-04-17T09:00:56 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,948 | Bug: Reactjs Navigation issue | closed | MuhammadAhmed-Developer |
Issue: Browser Back Button Requires Two Clicks to Navigate Back from Blog Detail Page in React App
Description:
When navigating to the blog detail page via navigate(...) using React Router, the browser back button does not behave as expected. After reaching the blog detail page, clicking the browser’s back button once does not return the user to the previous page. The user is required to press the back button twice to go back. This issue occurs consistently, especially after navigating from a page with query parameters in the URL. | 1 | 2025-04-17T07:21:16 | 2025-04-17T11:45:07 | [
"Status: Unconfirmed",
"Resolution: Support Redirect"
] | [
{
"body": "This sounds like an issue with https://github.com/remix-run/react-router. You should file an issue there instead.",
"created_at": "2025-04-17T11:45:01Z",
"id": 2812613400,
"updated_at": "2025-04-17T11:45:01Z",
"user": "eps1lon"
}
] |
facebook/react | 32,947 | [Compiler Bug]: Property 'tsSatisfiesExpression' does not exist on type... | open | saul-atomrigs | ### 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/facebook/react/blob/4a36d3eab7d9bbbfae62699989aa95e5a0297c16/compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts#L2119
### Repro steps
<img width="617" alt="Image" src="https://github.com/user-attachments/assets/cb86c6ca-3fb4-469a-a33d-4c427feca386" />
`tsSatisfiesExpression` type error in:
https://github.com/facebook/react/blob/4a36d3eab7d9bbbfae62699989aa95e5a0297c16/compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts#L2119
related PR:
- https://github.com/facebook/react/pull/32742
- https://github.com/facebook/react/pull/29818
### How often does this bug happen?
Every time
### What version of React are you using?
19.1.0 (latest)
### What version of React Compiler are you using?
latest | 0 | 2025-04-17T07:03:41 | 2025-04-17T07:03:41 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,946 | [React 19.1] useEffect cleanup running too late / useRef cleanup too early? | open | szhsin | React version: 19.1.0
Not sure if this is considered a bug, but I recently updated one of my repos to React 19.1 and noticed different behavior regarding useEffect/useRef cleanup timing.
When setting up a `ResizeObserver` callback in a `useEffect`, sometimes the resize callback is still called after the refs within the component have been destroyed. This can cause a `TypeError` when trying to access a null ref if not properly checked.
**This only happens in the latest React 19.1, not in any previous versions.**
## Steps To Reproduce
1. Go to the CodeSandbox link: https://codesandbox.io/p/sandbox/react-issue-null-ref-kl7l7t
2. Open the browser’s console tab
3. Move the mouse on and off the button continuously — the error should appear shortly.
Here’s a video link as well:
https://github.com/user-attachments/assets/651f7fd9-c163-479c-b242-38581cf7c91e
## The expected behavior
Refs attached to elements in the current component should not be null, as we expect them to be safe to access while the component is still mounted.
## Use case background
I'm building a tooltip that appears when hovering over an element. The tooltip’s content may update while it's displayed, so I use a `ResizeObserver` to monitor size changes and reposition the tooltip relative to the anchor element.
While the issue can be easily avoided by checking if the ref is null, it could come as a surprise for people updating to React 19.1. Also thought it might indicate a recent regression in React itself. | 3 | 2025-04-17T06:01:54 | 2025-04-18T10:43:39 | [
"Status: Unconfirmed"
] | [
{
"body": "You probably want to setup the observer in a ref callback anyway. Any resizes between the browser paint and the effect running, are already dropped.\n\nThere's also generally no guarantee that refs are attach during the Effect. E.g. when you refactor from a local `div` to a custom Component you wouldn't know when the ref is actually attached e.g. due to conditional rendering or Suspense boundaries.\n\nThis is expected behavior.",
"created_at": "2025-04-17T11:49:03Z",
"id": 2812621515,
"updated_at": "2025-04-17T11:49:03Z",
"user": "eps1lon"
},
{
"body": "This is a simplified example, but in a real-world scenario, you often need to access multiple local elements with different refs when setting up the observer. In those cases, useEffect has usually been the place where you can safely assume all local refs are attached, based on my experience with React.\n\nThat said, since the observer callback is outside of React's lifecycle, I get that there's no guarantee the refs will always be attached when it runs.",
"created_at": "2025-04-18T04:08:36Z",
"id": 2814492795,
"updated_at": "2025-04-18T04:08:36Z",
"user": "szhsin"
},
{
"body": "Here’s a comment you can write for the second issue:\n\n---\n\nThank you for reporting this issue! The behavior you described with `useEffect` and `useRef` cleanup in React 19.1 is indeed unexpected and could signal a regression. Checking for `null` refs is a good workaround, but this scenario should ideally be handled gracefully by React itself.\n\nI reviewed your reproduction steps and the CodeSandbox link, and the issue seems to be reproducible consistently. It would be helpful to include the specific React version you were using in your tests. Additionally, providing information about the environment (e.g., browser, Node.js version) could further assist in diagnosing this issue.\n\nIt might also be worth investigating whether this behavior is related to any recent changes in React's lifecycle management. I recommend tagging this issue with `Component: Hooks` or reaching out to maintainers who have worked on related features.\n\nLooking forward to seeing a resolution for this!\n\n",
"created_at": "2025-04-18T10:43:38Z",
"id": 2815228005,
"updated_at": "2025-04-18T10:43:38Z",
"user": "MunawarAbbas313"
}
] |
facebook/react | 32,942 | Bug: | open | ghost | <!--
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
| 0 | 2025-04-17T02:12:45 | 2025-04-17T02:12:45 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,927 | Bug: Uncaught TypeError: Cannot read properties of undefined (reading 'H') | open | dfsfyt | When I'm debugging in a local project with react source code, it reports an error
1. yarn create vite react-debugger --template react
2. git clone https://github.com/facebook/react.git
3. copy react/packages/* to react-debugger/src/react
4. change vite.config.js
```js
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
// 配置别名
alias: {
react: path.posix.resolve("src/react/packages/react"),
"react-dom": path.posix.resolve("src/react/packages/react-dom"),
"react-client": path.posix.resolve("src/react/packages/react-client"),
"react-dom-bindings": path.posix.resolve(
"src/react/packages/react-dom-bindings"
),
"react-reconciler": path.posix.resolve(
"src/react/packages/react-reconciler"
),
scheduler: path.posix.resolve("src/react/packages/scheduler"),
shared: path.posix.resolve("src/react/packages/shared"),
"dom-event-testing-library": path.posix.resolve("src/react/packages/dom-event-testing-library"),
"eslint-plugin-react-hooks": path.posix.resolve("src/react/packages/eslint-plugin-react-hooks"),
"internal-test-utils": path.posix.resolve("src/react/packages/internal-test-utils"),
"jest-react": path.posix.resolve("src/react/packages/jest-react"),
"react-art": path.posix.resolve("src/react/packages/react-art"),
"react-cache": path.posix.resolve("src/react/packages/react-cache"),
"react-debug-tools": path.posix.resolve("src/react/packages/react-debug-tools"),
"react-tools": path.posix.resolve("src/react/packages/react-tools"),
"react-tools-core": path.posix.resolve("src/react/packages/react-tools-core"),
"react-tools-extensions": path.posix.resolve("src/react/packages/react-tools-extensions"),
"react-tools-fusebox": path.posix.resolve("src/react/packages/react-tools-fusebox"),
"react-tools-inline": path.posix.resolve("src/react/packages/react-tools-inline"),
"react-tools-shared": path.posix.resolve("src/react/packages/react-tools-shared"),
"react-tools-shell": path.posix.resolve("src/react/packages/react-tools-shell"),
"react-tools-timeline": path.posix.resolve("src/react/packages/react-tools-timeline"),
"react-is": path.posix.resolve("src/react/packages/react-is"),
"react-markup": path.posix.resolve("src/react/packages/react-markup"),
"react-native-renderer": path.posix.resolve("src/react/packages/react-native-renderer"),
"react-noop-renderer": path.posix.resolve("src/react/packages/react-noop-renderer"),
"react-refresh": path.posix.resolve("src/react/packages/react-refresh"),
"react-server": path.posix.resolve("src/react/packages/react-server"),
"react-server-dom-esm": path.posix.resolve("src/react/packages/react-server-dom-esm"),
"react-server-dom-fb": path.posix.resolve("src/react/packages/react-server-dom-fb"),
"react-server-dom-parcel": path.posix.resolve("src/react/packages/react-server-dom-parcel"),
"react-server-dom-turbopack": path.posix.resolve("src/react/packages/react-server-dom-turbopack"),
"react-server-dom-webpack": path.posix.resolve("src/react/packages/react-server-dom-webpack"),
"react-suspense-test-utils": path.posix.resolve("src/react/packages/react-suspense-test-utils"),
"react-text-renderer": path.posix.resolve("src/react/packages/react-text-renderer"),
"use-subscription": path.posix.resolve("src/react/packages/use-subscription"),
"use-sync-external-store": path.posix.resolve("src/react/packages/use-sync-external-store"),
},
},
// 配置环境变量,解决__DEV__ is not defined
define: {
__DEV__: false, // 设置为false跳过 if(__dev__)的开发逻辑 这样会报错 需要修改jsx_dev的引入
__EXPERIMENTAL__: true,
__PROFILE__: true,
},
});
```
5. jsconfig.json
```js
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"react/*": ["src/react/packages/react/*"],
"react-dom/*": ["src/react/packages/react-dom/*"],
"react-client/*": ["src/react/packages/react-client/*"],
"react-dom-bindings/*": ["src/react/packages/react-dom-bindings/*"],
"react-reconciler/*": ["src/react/packages/react-reconciler/*"],
"scheduler/*": ["src/react/packages/scheduler/*"],
"shared/*": ["src/react/packages/shared/*"],
"dom-event-testing-library/*":["src/react/packages/dom-event-testing-library"],
"eslint-plugin-react-hooks/*":["src/react/packages/eslint-plugin-react-hooks"],
"internal-test-utils/*":["src/react/packages/internal-test-utils"],
"jest-react/*":["src/react/packages/jest-react"],
"react-art/*":["src/react/packages/react-art"],
"react-cache/*":["src/react/packages/react-cache"],
"react-debug-tools/*":["src/react/packages/react-debug-tools"],
"react-tools/*":["src/react/packages/react-tools"],
"react-tools-core/*":["src/react/packages/react-tools-core"],
"react-tools-extensions/*":["src/react/packages/react-tools-extensions"],
"react-tools-fusebox/*":["src/react/packages/react-tools-fusebox"],
"react-tools-inline/*":["src/react/packages/react-tools-inline"],
"react-tools-shared/*":["src/react/packages/react-tools-shared"],
"react-tools-shell/*":["src/react/packages/react-tools-shell"],
"react-tools-timeline/*":["src/react/packages/react-tools-timeline"],
"react-is/*":["src/react/packages/react-is"],
"react-markup/*":["src/react/packages/react-markup"],
"react-native-renderer/*":["src/react/packages/react-native-renderer"],
"react-noop-renderer/*":["src/react/packages/react-noop-renderer"],
"react-refresh/*":["src/react/packages/react-refresh"],
"react-server/*":["src/react/packages/react-server"],
"react-server-dom-esm/*":["src/react/packages/react-server-dom-esm"],
"react-server-dom-fb/*":["src/react/packages/react-server-dom-fb"],
"react-server-dom-parcel/*":["src/react/packages/react-server-dom-parcel"],
"react-server-dom-turbopack/*":["src/react/packages/react-server-dom-turbopack"],
"react-server-dom-webpack/*":["src/react/packages/react-server-dom-webpack"],
"react-suspense-test-utils/*":["src/react/packages/react-suspense-test-utils"],
"react-text-renderer/*":["src/react/packages/react-text-renderer"],
"use-subscription/*":["src/react/packages/use-subscription"],
"use-sync-external-store/*":["src/react/packages/use-sync-external-store"],
}
},
"exclude": ["node_modules", "dist"]
}
```
6. yarn add flow-remove-types -D
7. npx flow-remove-types --out-dir src/react src/react
8. change react-debugger/src/react/packages/react-reconciler/src/ReactFiberConfig.js to
```js
// throw new Error('This module must be shimmed by a specific renderer.');
export * from "./forks/ReactFiberConfig.dom"
```
9. npm run dev
### erro happened,like the below picture:
<img width="661" alt="Image" src="https://github.com/user-attachments/assets/0778709b-5a64-4030-8e0d-00f09ca30f78" />
代码地址:
https://github.com/dfsfyt/react-debugger | 0 | 2025-04-16T11:27:09 | 2025-04-16T11:27:09 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,926 | Bug: | closed | jasonsgitsit | <!--
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
| 0 | 2025-04-16T06:22:48 | 2025-04-16T22:02:13 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,915 | [Compiler Bug]: Unicode characters handled incorrectly | open | JCown | ### 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/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNv3H5F+ADxcAwhAC22OgjoFcGXAF5RIAO4JKcLQnyBeDcDSO2fwB6AHwL8ggNziAvuJBulg4BDZ0YATqWjp6BMb4-JgwEJhgwsbuIl5SMjBsyoRMAG7uwClpYAB0hui4-g6Oyq7FZQEg-kA
### Repro steps
When passing a unicode character as a prop, like `<MyComponent text="welcome 👋" />` then in RC output code we can see `<MyComponent text="welcome \uD83D\uDC4B" />` - unicode character gets replaced by "stringified" UTF-16 representation of it.
**Expected result (on the screen)**
Welcome 👋
**Actual result:**
Welcome \uD83D\uDC4B
### How often does this bug happen?
Every time
### What version of React are you using?
19.1
### What version of React Compiler are you using?
19.0.0-beta-ebf51a3-20250411 | 0 | 2025-04-15T13:53:26 | 2025-04-16T03:33:28 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,899 | Bug: | closed | mhmadsaleh-0 | <!--
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
| 0 | 2025-04-15T02:46:41 | 2025-04-15T07:47:14 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,867 | Bug: | closed | cheongai2024 | <!--
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
| 1 | 2025-04-13T12:39:01 | 2025-04-15T17:10:23 | [
"Status: Unconfirmed"
] | [
{
"body": "Hey 👋",
"created_at": "2025-04-14T13:00:34Z",
"id": 2801638165,
"updated_at": "2025-04-14T13:00:34Z",
"user": "bbygamer"
}
] |
facebook/react | 32,866 | Bug: | closed | cheongai2024 | <!--
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
| 0 | 2025-04-13T12:38:59 | 2025-04-15T17:10:09 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,857 | Test Issue from GitHub MCP Server | closed | LalaIAm | This is a test issue created to demonstrate the GitHub MCP server capabilities. Please disregard. | 0 | 2025-04-11T19:19:46 | 2025-04-12T08:13:55 | [] | [] |
facebook/react | 32,854 | Bug: button not working | closed | prwkhar | <!--
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
| 0 | 2025-04-11T15:06:09 | 2025-04-11T15:11:01 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,852 | [DevTools Bug] Cannot add node "909" because a node with that id is already in the Store. | open | IvanGoranov02 | ### Website or app
Error
### Repro steps
Cannot see
### How often does this bug happen?
Every time
### DevTools package (automated)
react-devtools-extensions
### DevTools version (automated)
6.1.1-44c3d3d665
### Error message (automated)
Cannot add node "909" because a node with that id is already in the Store.
### Error call stack (automated)
```text
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1192232
at v.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1160378)
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1161985
at bridgeListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1572692)
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react
``` | 5 | 2025-04-11T11:56:38 | 2025-04-18T07:24:58 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1192232\n at v.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1160378)\n at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1161985\n at bridgeListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1572692)",
"created_at": "2025-04-14T10:11:26Z",
"id": 2801207133,
"updated_at": "2025-04-14T10:11:26Z",
"user": "JOBAYERAHAMED00"
},
{
"body": "same here! its happening ",
"created_at": "2025-04-15T14:42:57Z",
"id": 2805596822,
"updated_at": "2025-04-15T14:42:57Z",
"user": "csalazarPD"
},
{
"body": "+1 This started happening to me today.",
"created_at": "2025-04-15T15:53:53Z",
"id": 2806538024,
"updated_at": "2025-04-15T15:53:53Z",
"user": "vegerot"
},
{
"body": "just happened now",
"created_at": "2025-04-16T13:18:45Z",
"id": 2809567702,
"updated_at": "2025-04-16T13:18:45Z",
"user": "LennyLouis"
},
{
"body": "Any updates ?",
"created_at": "2025-04-18T07:24:57Z",
"id": 2814776668,
"updated_at": "2025-04-18T07:24:57Z",
"user": "pranavmappoli"
}
] |
facebook/react | 32,836 | [DevTools Bug]: Firefox devtools extension doesn't work with React 19 | open | shardul-b | ### Website or app
https://vite.new/react
### Repro steps
I am using React 19 for my project and when I tried to access the components and profiler in Firefox. I got the following message:
```
Unsupported React version detected
This version of React DevTools supports React DOM v15+ and React Native v61+.
In order to use DevTools with an older version of React, you'll need to [install an older version of the extension](https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back).
```
However the same works in Chrome with Devtools version: `6.1.1 (2/7/2025)`
I have provided a sample project from the vite react template where this could be reproduced (as I was working on localhost) [stackblitz link](https://stackblitz.com/edit/vitejs-vite-8a1t8yxc?file=index.html&terminal=dev)
Screenshot:
<img width="409" alt="Image" src="https://github.com/user-attachments/assets/79f96d1c-7332-48cf-9cf8-d5663ac37ce5" />
### How often does this bug happen?
Every time
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 1 | 2025-04-09T13:49:06 | 2025-04-10T12:52:41 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "This could be related to:\n\n1. https://github.com/facebook/react/issues/17033\n2. https://github.com/facebook/react/issues/32771",
"created_at": "2025-04-09T13:50:24Z",
"id": 2789809474,
"updated_at": "2025-04-09T13:50:24Z",
"user": "shardul-b"
}
] |
facebook/react | 32,835 | [DevTools Bug]: symbolicated sourcemaps won't fetch for rsc components on Chrome 135.0.7 (rsc:// and webpack:// prefixed fetches fail) | open | jamiesunderland | ### Website or app
localhost:3000
### Repro steps
Download latest chrome (135.0.7049.85). Tested on Apple Silicon.
Start fresh next project (15.2.3+).
fileFetcher will fail to fetch resources when you inspect the default page.tsx component.
This is a really annoying bug because it ends up giving the unsymbolicated source map line number + column number, which is deceptive.
```
fileFetcher.js:1 Fetch API cannot load rsc://React/Server/webpack-internal:///(rsc)/app/page.tsx?19. URL scheme "rsc" is not supported.
fileFetcher.js:1 Fetch API cannot load webpack-internal:///(app-pages-browser)/node_modules/next/dist/client/image-component.js. URL scheme "webpack-internal" is not supported.
```
Would love for _debugSource to come back 😢
### How often does this bug happen?
Every time
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 0 | 2025-04-09T05:45:53 | 2025-04-09T05:59:11 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [] |
facebook/react | 32,824 | Bug: irregular behaviour of sidescroll when webpage zoomed-in | open | AnimeshKumar923 | React version: _NA_
## System details:
- Ubuntu 24.04.2 LTS
- Google Chrome _[Version 134.0.6998.88 (Official Build) (64-bit)]_
## Screen recording
https://github.com/user-attachments/assets/23be8b42-e362-435f-9946-dbe217f56958
## Steps To Reproduce
1. Go to this [docs link](https://react.dev/learn/state-a-components-memory) on Chrome browser
2. Make browser full-screen.
3. Zoom-in page to 110% and check the [code illustration](https://react.dev/learn/state-a-components-memory#when-a-regular-variable-isnt-enough)
Link to code example: _NA_
## The current behavior
The codesandbox preview being rendered should not fluctuate as you can see in the screen recording. The preview fluctuates in 110% zoom level, but when I revert it back to 100% it remains static.
## The expected behavior
The preview being rendered should remain static as in any other zoom levels | 3 | 2025-04-06T05:58:46 | 2025-04-15T12:54:39 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi, @AnimeshKumar923 I am contributing for first time and would like to work on this issue. Could I give a try?",
"created_at": "2025-04-07T18:52:10Z",
"id": 2784263506,
"updated_at": "2025-04-07T18:52:10Z",
"user": "shahriya1995"
},
{
"body": "@shahriya1995 Yes, you can. But before working on it, can you provide your approach on how you're going to solve it?",
"created_at": "2025-04-08T04:16:18Z",
"id": 2785178291,
"updated_at": "2025-04-08T04:16:18Z",
"user": "AnimeshKumar923"
},
{
"body": "Couldn't reproduce, but this should be fixable using [scrollbar-gutter](https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter) css property ",
"created_at": "2025-04-15T12:54:38Z",
"id": 2804959530,
"updated_at": "2025-04-15T12:54:38Z",
"user": "Amirali-Amirifar"
}
] |
facebook/react | 32,818 | Bug: Sidebar Dropdown Does Not Collapse on Second Click in React Documentation | open | SahilPatel2003 | In the official React documentation, when I click on the dropdown button (▾) for a topic in the sidebar, it expands as expected. However, clicking on the same dropdown again does not collapse the section.
It only collapses when I click on another topic’s dropdown, which is inconsistent behavior and confusing from a UX perspective.
React version: 19.1
## Steps To Reproduce
1. Go to the [React documentation](https://react.dev/).
2. Click on any dropdown (e.g., "Learn React" or "API Reference") in the left sidebar to expand it.
3. Click again on the same dropdown.
4. Observe that the dropdown does not collapse.
5. Click on a different dropdown.
6. Observe that the previous one collapses.
<!--
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://react.dev/reference/react/hooks
<!--
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
Clicking on the same dropdown icon does not collapse the section.
The only way to collapse a section is to open a different section.
## The expected behavior
Clicking on the same dropdown icon should toggle (expand/collapse) the section.
This behavior is expected and more intuitive for users.

| 5 | 2025-04-04T10:22:04 | 2025-04-15T09:19:16 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi! I was able to reproduce this issue in React 19.1. I'd love to work on fixing it. Could you assign this to me?",
"created_at": "2025-04-04T15:23:04Z",
"id": 2779064671,
"updated_at": "2025-04-04T15:23:04Z",
"user": "Sanyam2511"
},
{
"body": "Hey! If no one is working on this, could you assign this to me? I am pretty sure I can fix this one",
"created_at": "2025-04-04T15:35:15Z",
"id": 2779108750,
"updated_at": "2025-04-04T15:35:15Z",
"user": "AfnanFerdousi"
},
{
"body": "Hii, sharp insight. Allow me to resolve this issue just by altering state of a variable using react hook useState. Could you please authorize my access to the repository? ",
"created_at": "2025-04-04T18:29:57Z",
"id": 2779479201,
"updated_at": "2025-04-04T18:29:57Z",
"user": "Pankaj-70"
},
{
"body": "Hi @SahilPatel2003,\nSharp observation! I’d love to contribute and resolve this issue.",
"created_at": "2025-04-05T13:29:55Z",
"id": 2780725348,
"updated_at": "2025-04-05T13:29:55Z",
"user": "amankumarnayak"
},
{
"body": "@SahilPatel2003 \n\nThis is the wrong repository to open this issue — it should’ve been on [react.dev](https://github.com/reactjs/react.dev).\n\nNo worries though, feel free to open it there. In fact, there's already an existing issue discussing it.\n\nAlso, this is a feature, not a bug! I don't have the link to the previous issue that explains why it works this way, but it does. 🙂",
"created_at": "2025-04-15T09:19:15Z",
"id": 2804395211,
"updated_at": "2025-04-15T09:19:15Z",
"user": "ajuchacko"
}
] |
facebook/react | 32,811 | Bug: createRoot().render() is not fully synchronous unless wrapped in flushSync, unlike legacy ReactDOM.render | closed | jukben | <!--
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.2.0 (reproduced in latest 19.1 as well)
---
## Summary
There is [an open issue](https://github.com/reactjs/react.dev/issues/7317) proposing documentation updates around the use of `flushSync` with `createRoot().render()` to enforce synchronous rendering. However, since that issue has gone without feedback for several months, and given the core behavior observed, I suspect this may be an actual bug in React rather than just a documentation gap. I'm opening this issue here in the main React repository to clarify whether this behavior is intentional or not.
---
## Steps To Reproduce
1. Render a basic React app using `createRoot(...).render(<App />)`.
2. Inside `<App />`, log messages from `useLayoutEffect` and `useEffect`.
3. Log messages before and after `root.render()` call.
4. Compare behavior between:
- `createRoot(...).render(...)` (modern API)
- `flushSync(() => root.render(...))`
- Legacy `ReactDOM.render(...)`
---
**Link to code example:** [CodeSandbox](https://codesandbox.io/p/sandbox/react-and-synchronous-react-render-jkpcz7?file=%2Fsrc%2Findex.js)
---
## The current behavior
Using `createRoot(...).render(...)` without wrapping in `flushSync`, we observe that:
- The log inside `useLayoutEffect` is emitted **after** `console.log("Post root.render")`, indicating the effect happens *after* the render call resolves.
- In contrast, using `flushSync(() => root.render(...))` or legacy `ReactDOM.render(...)`, `useLayoutEffect` is called *before* the post-render log.
This suggests the modern root API allows post-render behavior to interleave with layout effects, even outside of explicitly opted-in concurrent features. This might violate expectations around synchronous behavior of the initial render.
---
## The expected behavior
As [@rickhanlonii](https://github.com/rickhanlonii) noted in a related discussion, the initial render should be synchronous by default. If that’s the case, this behavior seems inconsistent.
- `createRoot(...).render(...)` should preserve layout effect timing consistency with legacy `ReactDOM.render(...)`, without needing to wrap in `flushSync`.
- If the current behavior is intentional, it would help to explicitly document that `createRoot(...).render(...)` may be async under certain conditions—even without concurrent features being enabled.
| 2 | 2025-04-03T12:19:08 | 2025-04-08T11:44:14 | [
"Status: Unconfirmed"
] | [
{
"body": "Once we start rendering, it's synchronous. But the actual `render()` call is not and always runs in the next microtask. It's the same as `setState` in that regard.\n\nWe can document in caveats under https://react.dev/reference/react-dom/client/createRoot#root-render. Could you file a PR making these changes? Similar for `hydrateRoot`",
"created_at": "2025-04-03T13:06:08Z",
"id": 2775729396,
"updated_at": "2025-04-03T13:06:08Z",
"user": "eps1lon"
},
{
"body": "Hey @eps1lon thanks a lot for clarifying! I put together this draft, could you take a look https://github.com/reactjs/react.dev/pull/7717",
"created_at": "2025-04-04T08:53:09Z",
"id": 2777986728,
"updated_at": "2025-04-04T08:53:09Z",
"user": "jukben"
}
] |
facebook/react | 32,806 | Bug: stylesheets that use precedence are significantly slower to render at scale | open | RJWadley | <!--
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, 19.1.0
## Steps To Reproduce
1. Render at least two precedence levels, for example 'a' and 'b' so that react can insert our stylesheets into the head rather than inline.
2. Render lots of style elements into 'a' (your first precedence level, the important part is that react inserts our stylesheets into the head) and observe performance. Compare this to rendering without any precedence at all.
<!--
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.
-->
Here's a codesandbox demonstrating the basic issue:
https://codesandbox.io/p/sandbox/react-style-perf-t7w9qr
Or a github repository, if you prefer:
https://github.com/RJWadley/react-style-perf
## The current behavior
Seems like each style tag is handled independently with very little optimization - which is probably fine if you only load one or two stylesheets but doesn't work well for larger amounts of styling. In the attached example, you should also notice that every time we toggle our styles with precedence our performance gets worse and worse.
<details>
<summary>
Here's a real example of render performance on my M1 mac pro. This isn't from the attached example, but is the same issue just at a larger scale:
</summary>
<img width="759" alt="Image" src="https://github.com/user-attachments/assets/70a25e71-7d83-491d-8804-e5eace03b1e4" />
Zooming in, most of the performance hit seems to come from query selectors and from actually inserting each stylesheet.
<img width="1497" alt="Image" src="https://github.com/user-attachments/assets/393c6d5a-c338-4ad5-801e-395851ebaab5" />
</details>
## The expected behavior
Stylesheets should ideally render in similar time regardless of precedence.
Related: https://github.com/facebook/react/issues/30739 | 3 | 2025-04-02T16:49:59 | 2025-04-03T20:56:08 | [
"Status: Unconfirmed"
] | [
{
"body": "Is this flamegraph from dev or prod? If it's only dev, could you also compare performance in prod?\n\nCould you also include timing comparisons between precedence and no precedence?",
"created_at": "2025-04-03T06:08:11Z",
"id": 2774588102,
"updated_at": "2025-04-03T06:08:11Z",
"user": "eps1lon"
},
{
"body": "We've (at @mui) have also come to a similar conclusion that the current implementation of of style hoisting (mainly on the client side) is rather slow pertaining to the `dom` querying that occurs to hoist each style tag.\nI was able to improve the perf on the client side with this [patch](https://github.com/brijeshb42/test-styling-engine/blob/main/patches/react-dom.patch) by a factor of 17 in a test of rendering 10000 different components with a `style` tag having both `href` and `precedence`.\nReact v19 took `3659.1043ms` to append the dom items vs `215.73ms` with the patch. Note that the patch is fully client side and does not consider hydration or RSC. So I am sure this isn't a proper solution, just something in the right direction.\n\n\n",
"created_at": "2025-04-03T11:24:27Z",
"id": 2775446855,
"updated_at": "2025-04-03T11:24:27Z",
"user": "brijeshb42"
},
{
"body": "@eps1lon the attached flamegraph is from a production next.js build with mangling disabled.\n\nSome timings:\n\n#### On A Production Site\nThe above patch does seem to help. It seems to have some issues with SSR though.\nstable react: 4.5s\npatched react: 97.88ms\n\nWhen I remove precedence the site gets much slower, likely due to the massively increased DOM size. Still, \nstable react, no precedence: 698.64 ms\npatched react, no precedence: 904.13 ms\n\n\n#### Within Codesandbox Reproduction\nIn the attached codesandbox example with the letters, I've observed this with mid-tier mobile CPU throttling:\nNo precedence: 1.01s\nWith precedence, first render: 5.65s\n\nBecause we're adding more and more to the DOM our performance will decrease over time. For example, when rerunning the letters example with precedence, a second render took 15.31s and our third took 26.88s",
"created_at": "2025-04-03T20:56:06Z",
"id": 2776900426,
"updated_at": "2025-04-03T20:56:06Z",
"user": "RJWadley"
}
] |
facebook/react | 32,805 | [DevTools Bug]: | closed | rayan2005643 | ### Website or app
https://github.com/facebook/react/issues/new/choose
### Repro steps
1. ****
### How often does this bug happen?
Often
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 1 | 2025-04-02T12:51:20 | 2025-04-02T18:08:14 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "Hi\n",
"created_at": "2025-04-02T14:35:23Z",
"id": 2772768165,
"updated_at": "2025-04-02T14:35:23Z",
"user": "rayan2005643"
}
] |
facebook/react | 32,804 | [Bug]: ERR_INVALID_ARG_TYPE occurs when I install project | closed | SongMinQQ | ### 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)
- [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- [x] react-compiler-healthcheck (build issue installing or using the healthcheck script)
### Link to repro
none. basic React template
### Repro steps
When I install my project in local environment, this error is occured.
`
12 verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
12 verbose stack at normalizeSpawnArguments (node:child_process:539:3)
12 verbose stack at spawn (node:child_process:746:13)
12 verbose stack at promiseSpawn (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:39:16)
12 verbose stack at spawnWithShell (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
12 verbose stack at promiseSpawn (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
12 verbose stack at runScriptPkg (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
12 verbose stack at runScript (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
12 verbose stack at #run (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\commands\run-script.js:131:13)
12 verbose stack at async RunScript.exec (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\commands\run-script.js:40:7)
12 verbose stack at async Npm.exec (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\npm.js:208:9)
13 error code ERR_INVALID_ARG_TYPE
14 error The "file" argument must be of type string. Received undefined
15 verbose cwd C:\Users\koe73\OneDrive\바탕 화면\app
16 verbose os Windows_NT 10.0.19045
17 verbose node v22.14.0
18 verbose npm v11.2.0
19 verbose exit 1
20 verbose code 1
`
I've tried several things so far:
Uninstalling and reinstalling Node.js
Updating npm
Switching to a Vite project
Deleting npm cathe
Before I started getting this error, I was using Node.js version 18.17.1.
When I switch back to 18.17.1, the error doesn't occur.
But I really want to use the latest LTS version...
Help me plz..
### How often does this bug happen?
Every time
### What version of React are you using?
19.0.0
### What version of React Compiler are you using?
Node.Js 22.14.0(lts) | 3 | 2025-04-02T04:38:51 | 2025-04-02T14:02:20 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [
{
"body": "Since I'm not using Windows, I can't confirm exactly, but it seems the error occurred because the Korean word '바탕화면' (Desktop) is in the file path. This is a common error when running Node on Windows, though I'm not entirely sure.",
"created_at": "2025-04-02T04:53:09Z",
"id": 2771336465,
"updated_at": "2025-04-02T04:53:09Z",
"user": "koreanddinghwan"
},
{
"body": "Hello!\nIt seems that as @koreanddinghwan mentioned, the error is coming from the filepath.\n\nWhat \"react basic template\" are you using?\n\nPlease try creating a new template using Vite or another bundler. I suggest you use the following command from the Vite documentation:\n\n````bash\nnpm create vite@latest my-react-app -- --template react\n````\n\nThen navigate to the project's directory, install && run the application.\n````bash\ncd my-react-app\nnpm install\nnpm run dev\n````\nI've just tested this and it's working fine, let me know if worked for you as well.",
"created_at": "2025-04-02T13:15:55Z",
"id": 2772535072,
"updated_at": "2025-04-02T13:15:55Z",
"user": "sergiotales1"
},
{
"body": "I found the cause of the problem and fixed it temporarily.\n\nThank you for your help and advice!!😆\n\nhttps://github.com/npm/cli/pull/8205",
"created_at": "2025-04-02T13:59:46Z",
"id": 2772658656,
"updated_at": "2025-04-02T14:01:36Z",
"user": "SongMinQQ"
}
] |
facebook/react | 32,798 | [React 19] renderToPipeableStream emits </html> in different order? | open | liuyenwei | <!--
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.1.0
We're currently upgrading from React 18 -> 19 and we're noticing what appears to be a slight change in the how `renderToPipeableStream` works. Specifically around the `</body></html>` being sent down as a separate chunk once all suspended content has been rendered.
Mostly curious if this an expected change? I went through the [changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md#1900-december-5-2024) but couldn't find anything that pointed to this.
**Context**
During server render, we discover "dynamic content" (image preload URLs, lazy load scripts, etc) and inject them into the response stream using a technique very similar to [this](https://github.com/reactwg/react-18/discussions/114). To ensure we don't start injecting too early, we will wait until the initial shell has been streamed down before we start injecting the dynamic content into the stream.
We noticed after upgrading to React 19, our previous assumptions were no longer valid since dynamic content was now being injected incorrectly between partial html.
## Steps To Reproduce
1. Render a full HTML document (containing _something_ that suspends) using `renderToPipeableStream`.
Ex:
```
<html lang="en">
<head />
<body>
<Suspense fallback={<div>hello</div>}>
<ThingThatSuspends />
</Suspense>
</body>
</html>
```
2. Confirm that in React 18.3, `</body></html>` is sent as part of the initial chunk _before_ `ThingThatSuspends` renders. Confirm in React 19, its sent down as a separate chunk _after_ `ThingThatSuspends` renders.
| 2 | 2025-04-01T03:58:14 | 2025-04-02T17:25:11 | [
"Status: Unconfirmed"
] | [
{
"body": "Is this between 18.3 and 19.1 or 18.3 and 19.0? Curious if this only changed between 19.0 and 19.1",
"created_at": "2025-04-02T10:39:27Z",
"id": 2772157265,
"updated_at": "2025-04-02T10:39:27Z",
"user": "eps1lon"
},
{
"body": "tested 19.0 and saw the same behavior so seems like between 18.3 and 19.0",
"created_at": "2025-04-02T17:25:10Z",
"id": 2773245685,
"updated_at": "2025-04-02T17:25:10Z",
"user": "liuyenwei"
}
] |
facebook/react | 32,796 | Bug: suspense fallback flickers with nested suspended components | open | tien | Suspense fallback flicker multiple times with nested suspended children, even after they have already resolved all promises.
Wrapping children in their own `Suspense` boundary doesn't stop parent fallback from flickering, implying a boundary leak.
This issue started happening from `v19.1.0`. On `v19.0.0`, the fallback is only shown once as expected.
I'm currently working on a minimal reproduction. Here's what it looks like in one of my application:
https://github.com/user-attachments/assets/e8b57256-d52d-450a-beff-538843d79237 | 2 | 2025-04-01T01:35:48 | 2025-04-17T14:09:10 | [
"Status: Unconfirmed",
"Resolution: Needs More Information"
] | [
{
"body": "It doesn't look like this bug report has enough info for one of us to reproduce it.\n\nPlease provide a CodeSandbox (https://react.new), or a link to a repository on GitHub.\n\nHere are some tips for providing a minimal example: https://stackoverflow.com/help/mcve\n\n<!-- mui template next: https://material-ui.com/r/issue-template-next -->\n<!-- mui template stable: https://material-ui.com/r/issue-template-latest -->\n<!-- react template: https://react.new/ -->",
"created_at": "2025-04-02T10:41:29Z",
"id": 2772161809,
"updated_at": "2025-04-02T10:41:29Z",
"user": "eps1lon"
},
{
"body": "Struggling to create a minimal reproduction for this, but the issue does seems fairly consistence in my app :(",
"created_at": "2025-04-17T14:09:08Z",
"id": 2813059791,
"updated_at": "2025-04-17T14:09:08Z",
"user": "tien"
}
] |
facebook/react | 32,794 | Bug: Why server action request use "content-type: text/plain", this will cause the default WAF rule block the request. | closed | youweol-master | I'm using the nextjs framework with nginx + modsecurity in front of it.
I've found the ServerAction request is send http POST request use "content-type: text/plain" header, but not "content-type: application/json"
due to the document from coreruleset
>
> Content-Types that a client is allowed to send in a request.
> Default: |application/x-www-form-urlencoded| |multipart/form-data| |text/xml|
> |application/xml| |application/soap+xml| |application/json|
>
> Please note, that the rule where CRS uses this variable (920420) evaluates it with operator
> `@within`, which is case sensitive, but uses t:lowercase. You must add your whole custom
> Content-Type with lowercase.
>
> Bypass Warning: some applications may not rely on the content-type request header in order
> to parse the request body. This could make an attacker able to send malicious URLENCODED/JSON/XML
> payloads without being detected by the WAF. Allowing request content-type that doesn't activate any
> body processor (for example: "text/plain", "application/x-amf", "application/octet-stream", etc..)
> could lead to a WAF bypass. For example, a malicious JSON payload submitted with a "text/plain"
> content type may still be interpreted as JSON by a backend application but would not trigger the
> JSON body parser at the WAF, leading to a bypass.
>
> When additional JSON content types are legitimately used in a deployment,
> e.g. application/cloudevents+json, it is extremely important to ensure that a
> rule exists to enable the engine's JSON body processor for these additional
> JSON content types. Failure to do so can lead to a request body bypass. The
> default JSON rule in modsecurity.conf-recommended (200001) will only activate
> the JSON body processor for the specific content type application/json. The
> optional modsecurity.conf-recommended rule 200006 can be used to enable the
> JSON body processor for a wide variety of JSON content types.
with the default WAF configure, it will block POST with request "content-type: text/plain".
Is there any config to let the ServerAction send with "content-type: application/json". | 0 | 2025-03-31T11:49:22 | 2025-03-31T11:59:16 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,789 | Bug: eslint-plugin-react-hooks incorrectly flags useSomething() in loop, while allowing use() in React 19 | closed | JangHwanPark | React version: 19.0.0
eslint-plugin-react-hooks: 5.3.1
## Steps To Reproduce
1. Create a custom hook (e.g. useSomething)
2. Call it inside a loop
<!--
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:
```jsx
function App() {
for (const item of items) {
useSomething(item); // error
}
}
```
```jsx
function App() {
for (const item of items) {
use(item); // no error
}
}
```
<!--
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
Calling useSomething() inside a loop triggers a lint error:
React Hook "useSomething" may be executed more than once. Possibly because it is called in a loop.
But calling use() inside the same loop does not trigger an error.
## The expected behavior
React 19 allows use(promise) to be called in a loop, but eslint-plugin-react-hooks only allows use(), not custom hooks like useSomething().
Since React 19’s implementation no longer treats use() as special by name, ESLint should ideally match this behavior and allow user-defined useSomething() calls in the same pattern, or clearly define why use() is a special case.
| 2 | 2025-03-29T23:05:34 | 2025-04-02T10:54:36 | [
"Status: Unconfirmed"
] | [
{
"body": "Thanks for posting. This is definitely confusing but `use()` is a function, not a hook. Hence it doesn't have to follow the rules of Hooks, and it's okay to call `use()` in a loop while it's not ok to call hooks in loops. You can read more about use here: https://react.dev/reference/react/use",
"created_at": "2025-04-01T00:32:26Z",
"id": 2767721464,
"updated_at": "2025-04-01T00:32:26Z",
"user": "josephsavona"
},
{
"body": "Thank you for the clarification! Since use() is not considered a Hook and is intentionally exempt from the Rules of Hooks, the current lint behavior is expected. Closing this as it's working as intende",
"created_at": "2025-04-02T10:54:35Z",
"id": 2772190828,
"updated_at": "2025-04-02T10:54:35Z",
"user": "JangHwanPark"
}
] |
facebook/react | 32,784 | [Compiler Bug]: some values set to undefined after optimization | closed | cod1r | ### 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/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEwBUYCAyngIZ4IEC+BAZjBBgQDogwJVx5cOAO2FMoQ-mghCCcHjQQBhADYQwsBAB4AKgD4AFGiFo8aKsoD8yAtoCURYQQLKEhMHlwIAJgDVzUBGttAgAfEiEvBCYjbwIAXgIjEzNlRwIePFgZMQlTaX0hBAB3P2UAqxt7YDSnNCYCAuLSgIIAQjiE8Ujowq97d09ffzoEwpLhmvTXLIIBniGyhDT6YRWRIQB6DYIAJV5+AgALCAgAawI8Q5pZjx4wAioCADdhgiKTY6hCUgQ9+twSGRKAoHhEHspVEV7kwAVAsF4aEYAOYEaB4MBoSKo+ryfjCODSdyAii3bzNEYNJKmcwVOzxXQOGSyQmEADacFU6h4AF14sTgbRNHtMjAhNoAJ5YLR4SUICD1OS8WgqNQaHS6DX6fT2OIM6pMpwZGaKhQqrlaPSGYzU5S2ZZ2plG0WyTkaVb4lnEgAKPCeUlIfJ0ABoDC9FkEg0cIMovBUAEYnFxUISRtBIoSeACqESiMVj1gT0d4QlsQVC4W6efpjKcBKERI5qp4fJ+lEG5O1aTrRLIda8fMb5s7TO7RYAdKokfoAOQAJgi08jg402viHVmCD7Dtrnuj-YSy54w9q9X0xxj9idMj3aTqDVaYZaADIn4l01mcz1vJfps6byPXSPR8EG3KYRRkfQ90jXtpD6d11hySRpAIDBxUUNgcEKIQ8H0LBWCwMAqi7T08IQJ4WzIH0yP9MBcPwsAxzgQ40DgU4EBLVYQHoIA
### Repro steps
In the usePrevious hook, the log statement would print false for some renders in my project.
Logically, the log statement should never print false because those two things should be identical in value
### 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.0.0-beta-aeaed83-20250323 | 2 | 2025-03-29T11:44:29 | 2025-03-31T01:39:19 | [
"Component: Optimizing Compiler"
] | [
{
"body": "I'm happy to elaborate more or provide a project/github link, but for now I'm hoping somebody can use that playground link to reproduce because I hate codesandbox or stackblitz.",
"created_at": "2025-03-29T11:45:21Z",
"id": 2763317297,
"updated_at": "2025-03-29T11:45:21Z",
"user": "cod1r"
},
{
"body": "Hey there, thanks for posting. React Compiler relies on components obeying the rules of React. In particular, components and hooks must be idempotent. Given the same props and state, they should always return the same result. Additionally, props and state can’t be mutated (or else it’s easy to break the idempotence rule). \n\nIt looks like you’re using a function closure to create a mutable binding. This breaks the rules around idempotence, and likely explains the results you’re seeing. You can read more about this here: https://react.dev/reference/rules/components-and-hooks-must-be-pure\n\nI’d suggest switching to useState and calling setState if there’s a value you want to both update over time and read during render. ",
"created_at": "2025-03-31T01:39:03Z",
"id": 2764896555,
"updated_at": "2025-03-31T01:39:03Z",
"user": "josephsavona"
}
] |
trekhleb/javascript-algorithms | 2,047 | Test Issue from MCP Demo | open | ups216 | This is a test issue created to demonstrate the GitHub MCP server's functionality.
Please feel free to close this issue.
Thank you for maintaining this excellent educational resource! | 3 | 2025-04-15T08:40:41 | 2025-04-15T08:47:51 | [] | [
{
"body": "我已收到邮件。",
"created_at": "2025-04-15T08:43:44Z",
"id": 2804290360,
"updated_at": "2025-04-15T08:43:44Z",
"user": "beiluo214814"
},
{
"body": "本座正在渡劫,有事请留言......",
"created_at": "2025-04-15T08:45:23Z",
"id": 2804296414,
"updated_at": "2025-04-15T08:45:23Z",
"user": "mullore"
},
{
"body": "\n您的信件已经收到,我会尽快查阅,谢谢! ——林泽鹏\nThis is an automatic reply, confirming that your e-mail was received.Thank you",
"created_at": "2025-04-15T08:47:50Z",
"id": 2804307066,
"updated_at": "2025-04-15T08:47:50Z",
"user": "ZepLeonard"
}
] |
trekhleb/javascript-algorithms | 2,046 | Optimize Caesar Cipher Implementation and Enhance Robustness | open | Suhaniahirwar20 | Description:
The current Caesar cipher implementation works correctly for both encryption and decryption, but there are opportunities for optimization and added functionality:
Optimization: The getCipherMap function unnecessarily clones the charsMap object in every iteration, which can be simplified by directly updating the existing object.
Robustness: There are no checks for invalid inputs, such as non-string data types or empty strings. Adding input validation will make the functions more reliable.
Preserve Case: The cipher converts all characters to lowercase, losing the original case. Enhancing the logic to preserve the case would improve usability.
Suggested Fix:
Optimize the reduce method by removing redundant cloning.
Add input validation checks.
Implement case-sensitive encryption and decryption. | 3 | 2025-03-13T14:52:36 | 2025-03-22T15:50:02 | [] | [
{
"body": "Are you at least using a premium language model?",
"created_at": "2025-03-14T12:58:36Z",
"id": 2724614601,
"updated_at": "2025-03-14T12:58:36Z",
"user": "lazarljubenovic"
},
{
"body": "Yes, this is an advanced AI model capable of providing high-quality and detailed responses",
"created_at": "2025-03-22T14:57:12Z",
"id": 2745308823,
"updated_at": "2025-03-22T14:57:12Z",
"user": "Suhaniahirwar20"
},
{
"body": "❤️",
"created_at": "2025-03-22T15:50:01Z",
"id": 2745328703,
"updated_at": "2025-03-22T15:50:01Z",
"user": "simonalbert241"
}
] |
trekhleb/javascript-algorithms | 2,043 | Inconsistent File Naming: CamelCase vs PascalCase | open | carlIkai | Hello, while using your repository, I noticed that there is currently an inconsistency in file naming conventions. All JavaScript file names in the algorithms folder (with the exception of all sorting algorithms, Matrix.js from math and Knapsack.js from sets), are in camel case while all the JavaScript file names in data-structures, playground and utils/comparator are in pascal case. I propose changing file names from camel case to pascal case to enhance consistency in the repository. I'm new to OSS, so I thought this might be a good introduction to contributing. Let me know what you think! | 2 | 2025-02-26T14:44:03 | 2025-02-27T11:19:35 | [] | [
{
"body": "Start your OSS journey by not using AI to generate your posts.",
"created_at": "2025-02-27T01:49:46Z",
"id": 2686601563,
"updated_at": "2025-02-27T01:49:46Z",
"user": "lazarljubenovic"
},
{
"body": "I wrote the post, but can tell that the wording I used is too formal. I’m a cs student right now, so I guess I just have paper writing brain. This semester I’m taking OSS, and am trying to get some experience contributing. I was attracted to this repository because it was helpful when I was taking algorithms. I can definitely go elsewhere if this doesn’t feel like the right fit though.",
"created_at": "2025-02-27T11:19:34Z",
"id": 2687657600,
"updated_at": "2025-02-27T11:19:34Z",
"user": "carlIkai"
}
] |
trekhleb/javascript-algorithms | 2,038 | = document.getElementById('todo-list'); | open | Mothman910 | ```
let todo_container = document.getElementById('todo-list');
```
W pliku index.html
https://github.com/Mothman910/ja-i-niunis/blob/86f12d6184562a5cc7597932b56144215d473f76/index.html#L340-L354 | 0 | 2025-01-17T16:45:16 | 2025-01-17T16:45:16 | [] | [] |
trekhleb/javascript-algorithms | 2,037 | Popaj13 | closed | Popaj13 | null | 1 | 2025-01-17T10:58:10 | 2025-01-17T12:32:00 | [] | [
{
"body": "Hello👋\nI'm GENTIL LE NOIR, I'm a Web developper, programmer and a wanna join you to repositories.\nBut, I speak verry well the french than English please ",
"created_at": "2025-01-17T12:31:59Z",
"id": 2598267237,
"updated_at": "2025-01-17T12:31:59Z",
"user": "gentil-lenoir"
}
] |
trekhleb/javascript-algorithms | 2,033 | console.log(42 / +0); // Infinity
console.log(42 / -0); // -Infinity
| closed | Aya-arch-prog | null | 3 | 2024-12-29T04:46:48 | 2024-12-30T19:55:47 | [] | [
{
"body": "> (spole)\n\n",
"created_at": "2024-12-29T04:47:46Z",
"id": 2564612093,
"updated_at": "2024-12-29T04:47:46Z",
"user": "Aya-arch-prog"
},
{
"body": "Spole schmole",
"created_at": "2024-12-30T16:27:46Z",
"id": 2565686549,
"updated_at": "2024-12-30T16:27:46Z",
"user": "lazarljubenovic"
},
{
"body": "Hkgkgfleclelfrjegejfhfghh\r\nBkfjfjggff discussions yuiu for yotd\r\nFjuusfjsjdjdkdk CV dlzhehrk so far I'll\r\ndjdlejskdjdgdkdbsksvalkjsjsksksjskdjsjdjsjsjsjsjdjdjdhdkjkchcbvvbdjdbdjdjbbbdnwgjevejdhdjdjjdjdjdjfjfjfndhdjfhhfhj\r\nNknhdorgkfhfjfjfjfnfnfnfbdjhdvdjdhe8dhdhhdhdhdhhdhfhf\r\nBkdhejdjdjdjfjfjfhhhhfkfhfkfkvrlrgkfohddfdhjdghjhgghhhcjgwjvkgjcjwnvwnwjwjwjwhjwjwkvwwkwlwhwcwjwjwjwkwj\r\nHjjhgu,,,,,,fzysyduphohohogxhxvcjvjvjvjvjvjgugigifigigigztsyfoguxtzigifyxtkstdoyditutitaisozorsotarsruarsfsjchchchxyx🇿🇦4💓💋💋🇿🇦💓💔💞💓💓💞💔💔💔💋💓💋❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️💋7💞77💋\r\nCo Iyazi but I don't A TOPICS PENDEMICAL PUBLIC STRESSING you want me to\r\nwatch it where you at least khona ezinye izingane lapho bbe ngicela kungabi\r\nnalutho noma\r\n",
"created_at": "2024-12-30T19:06:02Z",
"id": 2565824426,
"updated_at": "2024-12-30T19:06:02Z",
"user": "Sbonelo01"
}
] |
trekhleb/javascript-algorithms | 1,264 | Is there a hungarian algorithm? It's good to have an implementaion of it in this project, imho | open | TimurRybakov | https://en.wikipedia.org/wiki/Hungarian_algorithm | 0 | 2024-10-28T13:43:27 | 2024-10-28T13:43:27 | [] | [] |
trekhleb/javascript-algorithms | 1,205 | Proposal to Add Secure Hash Algorithm ( SHA-1 ) Hashing Algorithm | open | RgiriH | #### Description
I would like to propose adding a SHA-1 hashing algorithm to our project. SHA-1 is a widely used cryptographic hash function that produces a 160-bit hash value, and it is often used for data integrity verification and digital signatures.
#### Rationale
- **Data Integrity**: Implementing SHA-1 will provide users with a reliable method to verify data integrity.
- **Compatibility**: Many existing systems and applications still rely on SHA-1 for hashing, making it a valuable addition.
- **Educational Value**: Including this algorithm can enhance the educational aspect of our project by showcasing a fundamental cryptographic concept.
#### Implementation Details
- The implementation will include:
- A hashing function that processes input strings and returns the SHA-1 hash in hexadecimal format.
- Unit tests to ensure the correctness of the implementation.
- Documentation on how to use the SHA-1 function. | 1 | 2024-10-21T17:58:08 | 2024-10-21T18:04:34 | [] | [
{
"body": "currently SHA1 is not available in most of the Javascript algorithm repositories which makes it difficult to use advance algorithms like SHA1 in JS , including SHA1 in this repo would be a great thing as this repo mainly focus on testing and education purpose .\r\n\r\nI have made a pull request after following all the contributed guidelines\r\n\r\n#### Name of the pull request :\r\n- Implementing , Testing and Documenting SHA1 algorithm",
"created_at": "2024-10-21T18:04:33Z",
"id": 2427384423,
"updated_at": "2024-10-21T18:04:33Z",
"user": "RgiriH"
}
] |
trekhleb/javascript-algorithms | 1,157 | DSA Js | closed | BhagvatVPatil | null | 0 | 2024-08-06T05:03:20 | 2024-09-04T18:38:38 | [] | [] |
trekhleb/javascript-algorithms | 1,154 | Least Common Multiple for a array of elements. | open | abhiphile | It will be better to also have a `leastCommonMultiple` function for an array where I could pass an array of elements and get the result.
```js
export default function leastCommonMultiple(a, b) {
return ((a === 0) || (b === 0)) ? 0 : Math.abs(a * b) / euclideanAlgorithm(a, b);
}
``` | 6 | 2024-07-20T10:25:19 | 2024-09-23T19:07:59 | [] | [
{
"body": "Can I work on this one?",
"created_at": "2024-07-24T19:33:07Z",
"id": 2248757321,
"updated_at": "2024-07-24T19:33:07Z",
"user": "mukund1606"
},
{
"body": "Yes Sure !",
"created_at": "2024-07-24T20:15:43Z",
"id": 2248821528,
"updated_at": "2024-07-24T20:15:43Z",
"user": "abhiphile"
},
{
"body": "Created a PR for LCM on array of numbers",
"created_at": "2024-07-25T06:53:38Z",
"id": 2249590261,
"updated_at": "2024-07-25T06:53:38Z",
"user": "mukund1606"
},
{
"body": "Can i work on it\r\n",
"created_at": "2024-09-06T09:13:28Z",
"id": 2333620331,
"updated_at": "2024-09-06T09:13:28Z",
"user": "AnshDwivedi03"
},
{
"body": "1\n",
"created_at": "2024-09-18T09:39:51Z",
"id": 2357983424,
"updated_at": "2024-09-18T09:39:51Z",
"user": "Vertabrae1"
},
{
"body": "Should I do it?",
"created_at": "2024-09-23T19:07:58Z",
"id": 2369139256,
"updated_at": "2024-09-23T19:07:58Z",
"user": "Subhrajyoti842"
}
] |
trekhleb/javascript-algorithms | 1,152 | Is not arithmetic shift better in countSetBits.js? | open | oThinas | The file `countSetBits.js` has the function:
```js
/**
* @param {number} originalNumber
* @return {number}
*/
export default function countSetBits(originalNumber) {
let setBitsCount = 0;
let number = originalNumber;
while (number) {
// Add last bit of the number to the sum of set bits.
setBitsCount += number & 1;
// Shift number right by one bit to investigate other bits.
number >>>= 1;
}
return setBitsCount;
}
```
I wonder if it wouldn't be better to use an arithmetic shift on line `number >>>= 1` instead of a logical shift, thus preserving the sign of the number. | 0 | 2024-07-19T03:11:03 | 2024-07-19T03:11:03 | [] | [] |
trekhleb/javascript-algorithms | 1,150 | closed | MrNavaj | 2 | 2024-07-07T13:29:25 | 2024-07-14T06:45:10 | [] | [
{
"body": "https://github.com/trekhleb/javascript-algorithms/issues/1150#issue-2394056916",
"created_at": "2024-07-07T13:29:50Z",
"id": 2212451343,
"updated_at": "2024-07-07T13:29:50Z",
"user": "MrNavaj"
},
{
"body": "I'd login kar nhi ha",
"created_at": "2024-07-07T13:30:15Z",
"id": 2212451466,
"updated_at": "2024-07-07T13:30:15Z",
"user": "MrNavaj"
}
] |
||
trekhleb/javascript-algorithms | 1,142 | HelloGitHub Badge | closed | 521xueweihan | 🎉 Congratulations! Your [project](https://hellogithub.com/repository/6a754391f9c84aa6830a6ed7927c4afb) has been featured and recommended by the HelloGitHub community. We invite you to join the HelloGitHub Badge Program. Joining will grant you the following privileges:
- **Community Recognition**: The badge indicates that your project has successfully passed the HelloGitHub community's stringent selection and recommendation process.
- **Increased Exposure**: Displaying the badge will draw more traffic to your project, attracting additional users and contributors.
- **Enhanced Interaction**: Users can quickly understand your project through the badge and engage with it (like, comment, bookmark).
- **Feedback Collection**: Gather genuine feedback from a broad user base, aiding in the continuous improvement of your project.
- **Special Identification**: Once verified, your comments will feature a distinctive mark and be prioritized for pinning.
📌 [Click here](https://hellogithub.com/repository/6a754391f9c84aa6830a6ed7927c4afb/embed) to wear the badge and join the HelloGitHub Badge Program, allowing your open-source project to shine even brighter.
---
**HelloGitHub** is a community focused on discovering, sharing, and promoting open-source projects. Since its inception in 2016, it has grown from a monthly newsletter into a dynamic community with over **10,000** users. Our footprint extends across multiple content platforms, earning the trust and support of **500,000** fans worldwide.
<img width="1245" alt="截屏2024-06-12 09 29 42" src="https://github.com/No-Chicken/OV-Watch/assets/8255800/7ac6b71e-f052-4f44-88b1-5c772e917348"> | 2 | 2024-06-12T10:30:47 | 2024-09-04T18:39:06 | [] | [
{
"body": "Como se obtendran estas insginias?",
"created_at": "2024-06-13T03:06:34Z",
"id": 2164271459,
"updated_at": "2024-06-13T03:06:34Z",
"user": "MAFLIXD"
},
{
"body": "hi",
"created_at": "2024-07-04T03:41:59Z",
"id": 2208066319,
"updated_at": "2024-07-04T03:41:59Z",
"user": "myapnacollege"
}
] |
trekhleb/javascript-algorithms | 1,136 | Add Circular Linked List to our list of recognized data structures.
| closed | gosthunrer | Objective:
Add Circular Linked List to our list of recognized data structures.
Proposal:
Circular Linked List should be added as a core data structure due to its unique functionalities and widespread applicability.
Reasoning:
Circular Iteration: Enables seamless circular iteration, valuable for cyclic data processing needs.
Efficient Queue Implementation: Forms the foundation for circular queues, allowing for efficient enqueue and dequeue operations without element shifting.
Memory Management: Simplifies cyclic reference handling in memory management tasks like garbage collection.
Circular Linked Lists extend the capabilities of linear data structures, making them a valuable addition to our toolkit.
| 2 | 2024-05-23T08:08:05 | 2024-05-23T18:13:58 | [] | [
{
"body": "We can all generate textbook examples of issues with ChatGPT, you know. It's not like it's a new thing anymore.",
"created_at": "2024-05-23T17:41:38Z",
"id": 2127719945,
"updated_at": "2024-05-23T17:41:38Z",
"user": "lazarljubenovic"
},
{
"body": "Thank you,, bro,,,,",
"created_at": "2024-05-23T18:13:56Z",
"id": 2127770045,
"updated_at": "2024-05-23T18:13:56Z",
"user": "gosthunrer"
}
] |
trekhleb/javascript-algorithms | 1,132 | Good | closed | Kapdia | . | 1 | 2024-05-15T22:51:11 | 2024-07-14T06:45:22 | [] | [
{
"body": "Indeed",
"created_at": "2024-05-15T23:20:55Z",
"id": 2113636517,
"updated_at": "2024-05-15T23:20:55Z",
"user": "lazarljubenovic"
}
] |
trekhleb/javascript-algorithms | 1,131 | Adding Circular Linked List In Data Structure. | open | vr-varad | **Issue Description**:
**Objective**:
Add Circular Linked List to our list of recognized data structures.
**Proposal**:
Circular Linked List should be added as a core data structure due to its unique functionalities and widespread applicability.
**Reasoning**:
1. Circular Iteration: Enables seamless circular iteration, valuable for cyclic data processing needs.
2. Efficient Queue Implementation: Forms the foundation for circular queues, allowing for efficient enqueue and dequeue operations without element shifting.
3. Memory Management: Simplifies cyclic reference handling in memory management tasks like garbage collection.
Circular Linked Lists extend the capabilities of linear data structures, making them a valuable addition to our toolkit. | 1 | 2024-05-12T19:33:02 | 2024-05-15T19:53:36 | [] | [
{
"body": "is this issue still open ?\r\n",
"created_at": "2024-05-15T19:53:35Z",
"id": 2113347080,
"updated_at": "2024-05-15T19:53:35Z",
"user": "Naveen-2021ucp1387"
}
] |
trekhleb/javascript-algorithms | 1,130 | Ok | closed | siddharthaslam061 | null | 0 | 2024-05-08T14:00:44 | 2024-07-14T06:45:30 | [] | [] |
trekhleb/javascript-algorithms | 1,126 | Learn | closed | donaldjohncapili | null | 1 | 2024-04-16T11:11:40 | 2024-07-14T06:45:38 | [] | [
{
"body": "Live and learn! ",
"created_at": "2024-04-16T21:04:49Z",
"id": 2059920976,
"updated_at": "2024-04-16T21:04:49Z",
"user": "lazarljubenovic"
}
] |
trekhleb/javascript-algorithms | 1,125 | Ne data project | closed | kelvinmike403 | null | 0 | 2024-04-16T02:43:43 | 2024-07-14T06:45:46 | [] | [] |
trekhleb/javascript-algorithms | 1,120 | My dsa roadmap | closed | riyaz345C | null | 2 | 2024-03-25T17:41:49 | 2024-07-14T06:45:53 | [] | [
{
"body": "Do you need DSA roadmap?",
"created_at": "2024-03-29T00:35:19Z",
"id": 2026390902,
"updated_at": "2024-03-29T00:35:19Z",
"user": "talhabashir14"
},
{
"body": "Yes",
"created_at": "2024-03-29T04:12:26Z",
"id": 2026619120,
"updated_at": "2024-03-29T04:12:26Z",
"user": "riyaz345C"
}
] |
trekhleb/javascript-algorithms | 1,107 | is there support for support for `BigInt` | open | ganeshkbhat | is there support for support for `BigInt` | 1 | 2024-02-23T12:07:15 | 2024-02-23T19:07:53 | [] | [
{
"body": "yes",
"created_at": "2024-02-23T19:07:51Z",
"id": 1961849580,
"updated_at": "2024-02-23T19:07:51Z",
"user": "lazarljubenovic"
}
] |
trekhleb/javascript-algorithms | 1,106 | Why this pointing to global context is giving undefined, even when global variable is defined ? | open | utkarsh-1602 | this is my program
```
var status = "online"
setTimeout(() => {
const status = "offline"
const data = {
status: "not responding",
getStatus(){
return this.status;
}
}
console.log(data.getStatus())
console.log(data.getStatus.call(this))
}, 0);
```
why `console.log(data.getStatus.call(this))` is returning `undefined` ? | 4 | 2024-02-22T08:41:03 | 2024-12-21T18:26:24 | [] | [
{
"body": "I guess, when you call \"data.getStatus.call(this)\", getStatus method setting the value of \"this\" to global object. But inside getStatus method, \"this.status\" trying to access global object property , not the status property inside setTimeout.\r\n\r\nIf we change getStatus function to arrow function, issue will get resolved.\r\n\r\n`getStatus(){\r\n return this.status;\r\n }`",
"created_at": "2024-02-22T15:06:37Z",
"id": 1959645509,
"updated_at": "2024-02-22T15:06:49Z",
"user": "ManjulaP1012"
},
{
"body": "@ManjulaP1012 actually the expected output should be \"online\" as `this` is pointing to global object status. but I'm not understanding why its returning `undefined`",
"created_at": "2024-02-22T17:56:45Z",
"id": 1959972522,
"updated_at": "2024-02-22T17:57:00Z",
"user": "utkarsh-1602"
},
{
"body": "the reason it was returning `undefined` is that regular functions in `Javascript` have their own `this` context which does not automatically refer to the lexical scope of where they are defined that is why as [ManjulaP1012](https://github.com/ManjulaP1012) said that using arrow function will resolve it.\r\n\r\n> @ManjulaP1012 actually the expected output should be \"online\" as `this` is pointing to global object status. but I'm not understanding why its returning `undefined`\r\n\r\n",
"created_at": "2024-07-03T17:17:07Z",
"id": 2206839568,
"updated_at": "2024-07-03T17:17:07Z",
"user": "jayeshbhole7"
},
{
"body": "It should work, you can see the working example [here](https://nookiegrey.github.io/global-this/)\r\nBut if you use some builders like webpack or ecosystems like [codesandbox](https://v4qgdd.csb.app/) it'll not work, cose they wrap your code in IIFE",
"created_at": "2024-12-21T18:26:23Z",
"id": 2558195774,
"updated_at": "2024-12-21T18:26:23Z",
"user": "NookieGrey"
}
] |
trekhleb/javascript-algorithms | 1,103 | Pendekatan "Brute Force" dan "Divide and Conquer" | open | namikazel | Apa perbedaan antara paradigma algoritma "Brute Force" dan "Divide and Conquer" dalam pemecahan masalah? | 1 | 2024-02-09T19:43:16 | 2024-02-09T19:43:40 | [] | [
{
"body": "> Apa perbedaan antara paradigma algoritma \"Brute Force\" dan \"Divide and Conquer\" dalam pemecahan masalah?\r\n\r\nParadigma algoritma \"Brute Force\" dan \"Divide and Conquer\" adalah dua pendekatan umum dalam pemecahan masalah algoritma. \"Brute Force\" adalah pendekatan di mana semua kemungkinan solusi diuji secara berurutan dan yang terbaik dipilih. Sementara itu, \"Divide and Conquer\" adalah pendekatan di mana masalah besar dibagi menjadi submasalah yang lebih kecil, dipecahkan secara rekursif, dan kemudian solusi-solusi dari submasalah digabungkan untuk mendapatkan solusi untuk masalah asli. Perbedaan utama di antara keduanya adalah bahwa \"Brute Force\" cenderung menjadi lambat karena harus mengevaluasi semua kemungkinan solusi, sementara \"Divide and Conquer\" sering kali lebih efisien karena memecah masalah menjadi submasalah yang lebih kecil yang dapat dipecahkan secara terpisah dan kemudian digabungkan.",
"created_at": "2024-02-09T19:43:39Z",
"id": 1936505006,
"updated_at": "2024-02-09T19:43:39Z",
"user": "ifulxploit"
}
] |
trekhleb/javascript-algorithms | 1,102 | `replaceChild` method in BinaryTreeNode is not correct | open | le-huy-jh | Missing update parent. It should be
```replaceChild(nodeToReplace, replacementNode) {
if (!nodeToReplace || !replacementNode) {
return false;
}
if (this.left && this.left === nodeToReplace) {
this.left = replacementNode;
replacementNode.parent = this;
return true;
}
if (this.right && this.right === nodeToReplace) {
this.right = replacementNode;
replacementNode.parent = this;
return true;
}
return false;
}
``` | 1 | 2024-01-31T16:20:42 | 2024-02-05T18:38:27 | [] | [
{
"body": " explain(nodeToReplace, replacementNode) {\r\n if (!nodeToReplace || !replacementNode) {\r\n return false;\r\n }\r\n\r\n if (this.left && this.left === nodeToReplace) {\r\n this.left = replacementNode;\r\n replacementNode.parent = this;\r\n return true;\r\n }\r\n\r\n if (this.right && this.right === nodeToReplace) {\r\n this.right = replacementNode;\r\n replacementNode.parent = this;\r\n return true;\r\n }\r\n\r\n // Add the following update to set the parent of replacementNode correctly\r\n if (this.left && this.left.explain(nodeToReplace, replacementNode)) {\r\n return true;\r\n }\r\n\r\n if (this.right && this.right.explain(nodeToReplace, replacementNode)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n",
"created_at": "2024-02-05T18:38:26Z",
"id": 1927775674,
"updated_at": "2024-02-05T18:38:26Z",
"user": "Prakash-2002"
}
] |
trekhleb/javascript-algorithms | 1,095 | Unhandled Edge Case in Binary Search Implementation | open | ShadBalti |
The current implementation of the binary search algorithm in the JavaScript codebase does not handle a specific edge case where the target element is present multiple times in the sorted array. This issue is reported to address the potential misbehavior and propose a solution to handle scenarios where the binary search encounters duplicate elements.
**Steps to Reproduce:**
1. Input a sorted array containing duplicate elements.
2. Perform a binary search for a target element present multiple times in the array.
3. Observe the behavior when the target element is found.
**Expected Behavior:**
The binary search algorithm should reliably locate and return any occurrence of the target element in the sorted array, providing accurate indices for all instances.
**Current Behavior:**
The current implementation may not consistently handle scenarios where duplicate elements exist in the sorted array, leading to unpredictable results when searching for the target element. | 1 | 2023-12-31T13:53:18 | 2024-01-02T15:11:47 | [] | [
{
"body": "The claim is partially true. The current implementation of the binary search algorithm in the JavaScript code does not explicitly handle the case where the target element is present multiple times in the sorted array. The algorithm will find the index of the target element if it exists in the array, but it does not specify which occurrence of the element it will return. \r\n\r\nIn the code snippet:\r\n```\r\nif (comparator.equal(sortedArray[middleIndex], seekElement)) {\r\n return middleIndex;\r\n}\r\n```\r\nIf the target element is present multiple times, this condition will return the index of any occurrence of the element found during the search. It doesn't guarantee that it will return the first, last, or any specific occurrence of the element.\r\n\r\nIf handling duplicate elements in a specific way (e.g., returning the index of the first occurrence) is important for your use case, you might need to modify the binary search implementation accordingly. You could consider additional logic to determine how to handle duplicate elements based on your requirements.\r\n\r\nSo, while the claim is true in the sense that the provided implementation doesn't explicitly address the handling of duplicate elements, the behavior might still be acceptable depending on the context in which the binary search is used.\r\n",
"created_at": "2024-01-02T14:59:46Z",
"id": 1874134578,
"updated_at": "2024-01-02T15:11:47Z",
"user": "faresh9"
}
] |
trekhleb/javascript-algorithms | 1,092 | Traverse in Reverse is unnecessary complex | open | ivancho-ifa | The current implementation has time complexity `O(n^2)`. It could be improved to `O(n)` by using recursion. I think it would be beneficial to have both approaches as it is the classic dilemma time vs. memory optimization. | 4 | 2023-12-10T18:21:27 | 2024-01-24T12:17:50 | [] | [
{
"body": "nb",
"created_at": "2023-12-25T15:10:46Z",
"id": 1869021609,
"updated_at": "2023-12-25T15:10:46Z",
"user": "dahkjh"
},
{
"body": "@ivancho-ifa **which algorithm?**\r\n",
"created_at": "2024-01-02T15:20:14Z",
"id": 1874162220,
"updated_at": "2024-01-02T15:20:14Z",
"user": "faresh9"
},
{
"body": "which algorithm",
"created_at": "2024-01-17T16:34:53Z",
"id": 1896179558,
"updated_at": "2024-01-17T16:34:53Z",
"user": "Sanjay10tech"
},
{
"body": "Guys, I believe this issue is about the reverse traversal of a Linkedlist Datastructure.",
"created_at": "2024-01-24T12:17:49Z",
"id": 1908014948,
"updated_at": "2024-01-24T12:17:49Z",
"user": "leoimewore"
}
] |
trekhleb/javascript-algorithms | 1,085 | Would be great to see `discussions` tab brought to this repository | open | CodeEventHorizon | null | 0 | 2023-11-16T10:55:32 | 2023-11-16T10:55:32 | [] | [] |
trekhleb/javascript-algorithms | 1,083 | Data structures and algorithms by JavaScript | closed | Ahmedfadhle | null | 0 | 2023-11-07T20:40:54 | 2023-11-14T18:15:32 | [] | [] |
trekhleb/javascript-algorithms | 1,081 | Typo in Portuguese README | closed | DavdSamuel | I found a typo in the portuguese README, can i fix the typo and send a pull request? | 0 | 2023-11-07T01:02:33 | 2023-11-16T15:44:48 | [] | [] |
trekhleb/javascript-algorithms | 1,074 | Javadcript
| closed | nickdcoder | null | 0 | 2023-09-17T23:06:10 | 2023-11-14T18:15:38 | [] | [] |
trekhleb/javascript-algorithms | 1,070 | priorityQueue does not poll out as expected | open | zonglinlee | ```js
describe('priorityQueue Test:', () => {
it('should return correct priorityQueue results:', () => {
const pq = new PriorityQueue();
pq.add(1);
pq.add(2);
pq.add(3);
pq.add(4);
expect(pq.toString()).toBe('1,2,3,4');
expect(pq.poll()).toBe(1);
expect(pq.poll()).toBe(2);
expect(pq.poll()).toBe(3);
expect(pq.poll()).toBe(4);
});
});
```
now it poll out `1, 4, 3, 2 `, expected: `1,2,3,4` | 4 | 2023-09-06T03:23:41 | 2023-11-18T08:08:34 | [] | [
{
"body": "They have a writing error, the correct one is \"if\" and not 'it'.",
"created_at": "2023-09-06T10:00:26Z",
"id": 1708041030,
"updated_at": "2023-09-06T10:00:26Z",
"user": "stiven104"
},
{
"body": "You need to show me the poll method in priorityQueue? I think issue is occured due to that thing.",
"created_at": "2023-09-14T09:47:56Z",
"id": 1719125020,
"updated_at": "2023-09-14T09:47:56Z",
"user": "PranjalPatel14"
},
{
"body": "Is this issue is still open ? ",
"created_at": "2023-10-24T13:20:06Z",
"id": 1777192216,
"updated_at": "2023-10-24T13:20:06Z",
"user": "v-a14"
},
{
"body": "The priority queue extends the heap Class.\r\nThe poll() method, inherited by the priority queue class, is part of the Heap Class. I have pasted a portion of the code from the method below: \r\n\r\n ```\r\n// Move the last element from the end to the head.\r\n this.heapContainer[0] = this.heapContainer.pop();\r\n this.heapifyDown();\r\n```\r\n\r\nAs you can see, the poll method pushes the last element in the queue to the front. In your case, after the first element is 'polled', the last element, which is 4, will be moved to the front of the queue. The 'heapifyDown' method, then, sorts the queue based on a comparator function. The priority queue class overrides the compactor function of the heap Class to ensure the queue is sorted based on priority of the item and not its value. \r\n\r\n```\r\nthis.compare = new Comparator(this.comparePriority.bind(this));\r\n\r\ncomparePriority(a, b) {\r\n if (this.priorities.get(a) === this.priorities.get(b)) {\r\n return 0;\r\n }\r\n return this.priorities.get(a) < this.priorities.get(b) ? -1 : 1;\r\n }\r\n```\r\n\r\nSince the priorities of all the items in the queue are the same, the 'heapifyDown' method does not sort the queue after 4 is moved to the front. \r\n\r\n\r\nSo if you were to log the output of the toString method:\r\n\r\n```\r\npq.poll()\r\nconsole.log(pq.toString())\r\n```\r\n\r\nOutput:\r\n`'4,3,2'`\r\n\r\ninstead of \r\n`'2,3,4'`\r\n\r\nIf you are not going to assign priorities to the items in the queue, try using the minHeap data structure. When you use that data structure, the 'heapifydown' method will sort the queue based on the value of the item. You would get the output you were expecting. \r\n\r\n\r\n\r\n\r\n",
"created_at": "2023-11-18T08:07:05Z",
"id": 1817434430,
"updated_at": "2023-11-18T08:08:34Z",
"user": "fahad-ejaz"
}
] |
trekhleb/javascript-algorithms | 1,069 | JS Data structure And Algorithms | closed | peyman93 | null | 1 | 2023-09-04T22:49:02 | 2023-11-14T18:15:48 | [] | [
{
"body": "Beautiful. You've unlocked an achievement.",
"created_at": "2023-09-04T23:11:19Z",
"id": 1705757506,
"updated_at": "2023-09-04T23:11:19Z",
"user": "lazarljubenovic"
}
] |
trekhleb/javascript-algorithms | 1,064 | Binary Search file, comment typo | open | khushhalgarg112 | In Binary Search Code file line number 14 have a typo. Here name of the function should be lessThan() not lessThen() | 3 | 2023-08-27T05:04:57 | 2023-11-26T15:37:18 | [] | [
{
"body": "I've opened a pr for this typo: #1079 ",
"created_at": "2023-10-04T19:24:58Z",
"id": 1747503843,
"updated_at": "2023-10-04T19:24:58Z",
"user": "ir3ne"
},
{
"body": "> In Binary Search Code file line number 14 have a typo. Here name of the function should be lessThen ",
"created_at": "2023-10-27T03:31:53Z",
"id": 1782234922,
"updated_at": "2023-10-27T03:31:53Z",
"user": "rondales"
},
{
"body": "> > In Binary Search Code file line number 14 have a typo. Here name of the function should be lessThen\r\n\r\n",
"created_at": "2023-11-26T15:37:16Z",
"id": 1826815657,
"updated_at": "2023-11-26T15:37:16Z",
"user": "rondales"
}
] |
airbnb/javascript | 3,119 | HTML widget embed is broken since late March | closed | Arozeo | Hi there
Sorry if I'm not posting in the correct category, I'm quite new to GitHub
I have a client with a website where multiple AirBnB listings are embedded through the provided code when you're on a listing and you click on "Share" > "Embed"
For around 3 weeks now, the links behind those embeds are broken
The widget in itself does display correctly the listing's name, pictures, etc. But where you should be directed to a URL like https://www.airbnb.fr/room**s**/854945734656448731
With an S at the end of /rooms/
You are directed to the following URL
https://www.airbnb.fr/room/854945734656448731
Without and S. And therefore the link doesn't work ; it's broken


Could someone please investigate this ?
Many thanks in advance
Eliott | 1 | 2025-04-14T13:28:53 | 2025-04-14T14:50:13 | [] | [
{
"body": "Your issue is with the airbnb website, not with this project - please contact Airbnb support instead.",
"created_at": "2025-04-14T14:50:12Z",
"id": 2801979856,
"updated_at": "2025-04-14T14:50:12Z",
"user": "ljharb"
}
] |
airbnb/javascript | 3,118 | Does it support typescript? | closed | AntJiuFo | I noticed that the following code base is archived:
https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-typescript
Does typescript support can be used directly with the current codebase? Or use eslint-config-airbnb-typescript directly? | 3 | 2025-04-14T09:17:08 | 2025-04-14T15:04:03 | [] | [] |
airbnb/javascript | 3,117 | [spam] | closed | Mamonaminyar | I believe this was intentionally `es5-sham`. But perhaps the link should point to here? https://www.npmjs.com/package/es5-shim#shams
_Originally posted by @lencioni in https://github.com/airbnb/js-shims/pull/9#discussion_r277094916_
| 0 | 2025-04-12T20:36:05 | 2025-04-12T20:52:34 | [
"invalid"
] | [] |
airbnb/javascript | 3,115 | [spam] | closed | Freddy-Gity | null | 0 | 2025-04-06T19:56:07 | 2025-04-07T04:47:38 | [
"invalid"
] | [] |
airbnb/javascript | 3,113 | [spam] | closed | fsjusbzvzjzjdjdb | How can I navigate using JavaScript | 0 | 2025-03-30T12:26:55 | 2025-03-30T15:10:03 | [
"invalid"
] | [] |
airbnb/javascript | 3,112 | [spam] | closed | Ethan110501 | function askQuestion(question, choices, callback) {
let container = document.createElement("div");
container.innerHTML = `<h2>${question}</h2>`;
let buttonContainer = document.createElement("div");
buttonContainer.style.display = "flex";
buttonContainer.style.justifyContent = "center";
buttonContainer.style.flexWrap = "wrap";
choices.forEach(choice => {
let button = document.createElement("button");
button.textContent = choice;
button.style.fontSize = "24px";
button.style.padding = "15px 30px";
button.style.margin = "10px";
button.style.display = "inline-block";
button.onclick = () => callback(choice);
buttonContainer.appendChild(button);
});
container.appendChild(buttonContainer);
document.body.innerHTML = "";
document.body.appendChild(container);
let statsButton = document.createElement("button");
statsButton.textContent = "중간 통계 보기";
statsButton.style.fontSize = "14px";
statsButton.style.padding = "5px 10px";
statsButton.style.marginTop = "10px";
statsButton.onclick = () => verifyPassword(showStats);
document.body.appendChild(statsButton);
let responseCount = document.createElement("p");
responseCount.id = "response-count";
responseCount.style.fontSize = "16px";
responseCount.style.marginTop = "10px";
responseCount.textContent = `실시간 응답자 수: ${allResponses.length}`;
document.body.appendChild(responseCount);
}
document.addEventListener("keydown", function(event) {
if (!event.target.closest("button")) {
verifyPassword(() => alert("승인됨"));
event.preventDefault();
}
}, true);
document.addEventListener("contextmenu", function(event) {
verifyPassword(() => alert("승인됨"));
event.preventDefault();
}, true);
function verifyPassword(callback) {
let password = prompt("비밀번호를 입력하세요:");
if (password === "1111") {
callback();
} else {
alert("비밀번호가 틀렸습니다.");
}
}
const sleepChoices = ["4시간 미만", "4시간", "5시간", "6시간", "7시간", "8시간", "9시간 초과"];
const subjects = ["국어", "영어", "수학"];
const scoreChoices = ["40~50점", "50~60점", "60~70점", "70~80점", "80~90점", "90~95점", "95점 이상"];
let scoreMap = {"40~50점": 45, "50~60점": 55, "60~70점": 65, "70~80점": 75, "80~90점": 85, "90~95점": 92, "95점 이상": 97};
let allResponses = [];
let currentSubjectIndex = 0;
let currentResponse = {};
function nextStep(answer) {
if (!currentResponse.sleep) {
currentResponse.sleep = answer;
askQuestion(`${subjects[currentSubjectIndex]} 기말고사 점수는?`, scoreChoices, nextStep);
} else {
currentResponse[subjects[currentSubjectIndex]] = answer;
currentSubjectIndex++;
if (currentSubjectIndex < subjects.length) {
askQuestion(`${subjects[currentSubjectIndex]} 기말고사 점수는?`, scoreChoices, nextStep);
} else {
allResponses.push(currentResponse);
currentResponse = {};
currentSubjectIndex = 0;
let responseCount = document.getElementById("response-count");
if (responseCount) {
responseCount.textContent = `실시간 응답자 수: ${allResponses.length}`;
}
alert("다음 응답자를 위해 태블릿을 넘겨주세요.");
runSurvey();
}
}
}
function showStats() {
let stats = `총 응답 수: ${allResponses.length}\n\n`;
let sleepStats = {};
let scoreStats = {};
allResponses.forEach(response => {
let sleepKey = response.sleep;
sleepStats[sleepKey] = (sleepStats[sleepKey] || 0) + 1;
subjects.forEach(subject => {
let scoreKey = `${sleepKey} (${subject})`;
scoreStats[scoreKey] = (scoreStats[scoreKey] || []);
scoreStats[scoreKey].push(scoreMap[response[subject]]);
});
});
stats += "[수면 시간별 응답자]\n";
for (let key in sleepStats) {
stats += `${key}: ${sleepStats[key]}명\n`;
}
stats += "\n[수면 시간별 과목 점수 평균]\n";
for (let key in scoreStats) {
let scores = scoreStats[key];
let avg = (scores.reduce((a, b) => a + b, 0) / scores.length).toFixed(2);
stats += `${key}: 평균 ${avg}점\n`;
}
alert(stats);
}
function runSurvey() {
askQuestion("당신의 평균 수면 시간은 몇 시간 입니까?", sleepChoices, nextStep);
}
runSurvey(); | 0 | 2025-03-27T09:05:09 | 2025-03-27T12:39:27 | [
"invalid"
] | [] |
airbnb/javascript | 3,109 | Question about readme content | closed | mehrabshafae | I found an important topic regarding parallel tasks and how we should really use async/await properly so that the program doesn't crash and stays away from catching and handling errors.
```js
// IIFE
// Handle throw errors on async/await functions
// Any async function you define in JavaScript runs on a separate thread in Node.js or V8. When you use that function, you need to call it with await. If you don't, it will run in parallel on a different thread, and any errors that occur there won't be caught or managed, which can crash your program.
async function test() {
await new Promise((resolve) => setTimeout(resolve, 5000));
throw new Error("Runtime error");
}
// Bad
(async ()=> {
try{
test();
console.log("test called");
}catch(_){
console.log("Handle Runtime Error!!"); // doesn't work
}
})();
// Good
(async ()=> {
try{
await test();
console.log("test called");
}catch(_){
console.log("Handle Runtime Error!!");
}
})();
```
Has this not been added before or is it related to this repository? Can I make a pull request for it? | 5 | 2025-03-18T19:33:25 | 2025-03-19T22:26:34 | [] | [] |
airbnb/javascript | 3,106 | [spam] | closed | Abdulasker | null | 0 | 2025-03-11T20:54:27 | 2025-03-11T21:04:36 | [
"invalid"
] | [] |
facebook/react | 32,961 | Feature Request: allow for DOM mode insertion in createPortal | open | lucassardois | <!--
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.
-->
I know this is more of a feature request than a bug, but I did not find where to send feature request, so here it is:
React version: 18+
## Steps To Reproduce
1. Use `createPortal`
2. I would except `createPortal` to have the abilitty to insert node before, after etc. the passed element.
My use case is inserting React apps into a DOM I do not control from a web extension. The DOM placement matters.
<!--
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
It only append element to the DOM.
## The expected behavior
It can append element or insert before the provided DOM element.
| 0 | 2025-04-18T14:20:27 | 2025-04-18T14:21:24 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,960 | Feature Request: add useEffect callback argument | open | cgx-system | This is not a bug, but I didn't find any other place to ask for new features. Sorry if it bothers you.
It would be really useful to pass an argument to a useEffect callback and get an array of the dependencies that triggered the effect, eventualy with their previous values. Something like that :
```
useEffect(prev => {
console.log(prev)
}, [dep1, dep2, dep3]
//=> [ { name: 'dep1', prevValue: <value> }, { name: 'dep3', prevValue: <value>} ]
```
If there is a better existing way to achieve the same thing, please tell me. | 2 | 2025-04-18T11:32:48 | 2025-04-18T14:19:27 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi there! I understand that you'd like to track the previous values of dependencies in useEffect. While React doesn’t support this functionality directly, you can achieve this by using a custom hook. Here's a simple implementation that might help:\n\n```\nimport { useRef, useEffect } from 'react';\n\nfunction usePreviousValue(dep) {\n const prevRef = useRef();\n useEffect(() => {\n prevRef.current = dep;\n }, [dep]);\n return prevRef.current;\n}\n```\n\nThis custom hook will allow you to track the previous values of dependencies like dep1, dep2, etc. Feel free to give it a try!",
"created_at": "2025-04-18T13:46:43Z",
"id": 2815482416,
"updated_at": "2025-04-18T13:46:43Z",
"user": "Axhataaa"
},
{
"body": "Thanks a lot for this trick. It allows to keep track of the previous dependency value, but what if I want to know which dependency triggered the effect ? I could compare all the dependencies with their previous values, but it could greatly impact code readability and performances with complex objects !\n\nI couldn't find where the useEffect hook is defined in React code, but I guess it is already doing this comparison before triggering the effect, so it could just pass it to the callback.\n\nBy the way, I'm surprised that this has not already been done...",
"created_at": "2025-04-18T14:19:26Z",
"id": 2815540755,
"updated_at": "2025-04-18T14:19:26Z",
"user": "cgx-system"
}
] |
facebook/react | 32,956 | . | closed | ghost | . | 0 | 2025-04-18T06:24:24 | 2025-04-18T06:26:24 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,955 | Vanessa Hudgens | closed | ghost | # Vanessa Hudgens Nude (19.38 GB MEGA) Folder #B0LyS
## [🔗👉👉 Click And Watch Vanessa Hudgens! 🔗](https://dar.vin/tommis)
[](https://dar.vin/tommis) | 0 | 2025-04-18T05:30:26 | 2025-04-18T05:30:29 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,954 | Bug: React 19.0.0 upgraded to 19.1.0, renderToPipeableStream Suspense fallback does not return the first fragment content | open | 10086XIAOZHANG | <!--
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
| 0 | 2025-04-18T03:30:23 | 2025-04-18T03:30:23 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,950 | [Compiler Bug]: Coverage report shows missing branch coverage | open | ValentinGurkov | ### 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.0.0-beta-ebf51a3-20250411 | 0 | 2025-04-17T09:00:56 | 2025-04-17T09:00:56 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,948 | Bug: Reactjs Navigation issue | closed | MuhammadAhmed-Developer |
Issue: Browser Back Button Requires Two Clicks to Navigate Back from Blog Detail Page in React App
Description:
When navigating to the blog detail page via navigate(...) using React Router, the browser back button does not behave as expected. After reaching the blog detail page, clicking the browser’s back button once does not return the user to the previous page. The user is required to press the back button twice to go back. This issue occurs consistently, especially after navigating from a page with query parameters in the URL. | 1 | 2025-04-17T07:21:16 | 2025-04-17T11:45:07 | [
"Status: Unconfirmed",
"Resolution: Support Redirect"
] | [
{
"body": "This sounds like an issue with https://github.com/remix-run/react-router. You should file an issue there instead.",
"created_at": "2025-04-17T11:45:01Z",
"id": 2812613400,
"updated_at": "2025-04-17T11:45:01Z",
"user": "eps1lon"
}
] |
facebook/react | 32,947 | [Compiler Bug]: Property 'tsSatisfiesExpression' does not exist on type... | open | saul-atomrigs | ### 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/facebook/react/blob/4a36d3eab7d9bbbfae62699989aa95e5a0297c16/compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts#L2119
### Repro steps
<img width="617" alt="Image" src="https://github.com/user-attachments/assets/cb86c6ca-3fb4-469a-a33d-4c427feca386" />
`tsSatisfiesExpression` type error in:
https://github.com/facebook/react/blob/4a36d3eab7d9bbbfae62699989aa95e5a0297c16/compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts#L2119
related PR:
- https://github.com/facebook/react/pull/32742
- https://github.com/facebook/react/pull/29818
### How often does this bug happen?
Every time
### What version of React are you using?
19.1.0 (latest)
### What version of React Compiler are you using?
latest | 0 | 2025-04-17T07:03:41 | 2025-04-17T07:03:41 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,946 | [React 19.1] useEffect cleanup running too late / useRef cleanup too early? | open | szhsin | React version: 19.1.0
Not sure if this is considered a bug, but I recently updated one of my repos to React 19.1 and noticed different behavior regarding useEffect/useRef cleanup timing.
When setting up a `ResizeObserver` callback in a `useEffect`, sometimes the resize callback is still called after the refs within the component have been destroyed. This can cause a `TypeError` when trying to access a null ref if not properly checked.
**This only happens in the latest React 19.1, not in any previous versions.**
## Steps To Reproduce
1. Go to the CodeSandbox link: https://codesandbox.io/p/sandbox/react-issue-null-ref-kl7l7t
2. Open the browser’s console tab
3. Move the mouse on and off the button continuously — the error should appear shortly.
Here’s a video link as well:
https://github.com/user-attachments/assets/651f7fd9-c163-479c-b242-38581cf7c91e
## The expected behavior
Refs attached to elements in the current component should not be null, as we expect them to be safe to access while the component is still mounted.
## Use case background
I'm building a tooltip that appears when hovering over an element. The tooltip’s content may update while it's displayed, so I use a `ResizeObserver` to monitor size changes and reposition the tooltip relative to the anchor element.
While the issue can be easily avoided by checking if the ref is null, it could come as a surprise for people updating to React 19.1. Also thought it might indicate a recent regression in React itself. | 3 | 2025-04-17T06:01:54 | 2025-04-18T10:43:39 | [
"Status: Unconfirmed"
] | [
{
"body": "You probably want to setup the observer in a ref callback anyway. Any resizes between the browser paint and the effect running, are already dropped.\n\nThere's also generally no guarantee that refs are attach during the Effect. E.g. when you refactor from a local `div` to a custom Component you wouldn't know when the ref is actually attached e.g. due to conditional rendering or Suspense boundaries.\n\nThis is expected behavior.",
"created_at": "2025-04-17T11:49:03Z",
"id": 2812621515,
"updated_at": "2025-04-17T11:49:03Z",
"user": "eps1lon"
},
{
"body": "This is a simplified example, but in a real-world scenario, you often need to access multiple local elements with different refs when setting up the observer. In those cases, useEffect has usually been the place where you can safely assume all local refs are attached, based on my experience with React.\n\nThat said, since the observer callback is outside of React's lifecycle, I get that there's no guarantee the refs will always be attached when it runs.",
"created_at": "2025-04-18T04:08:36Z",
"id": 2814492795,
"updated_at": "2025-04-18T04:08:36Z",
"user": "szhsin"
},
{
"body": "Here’s a comment you can write for the second issue:\n\n---\n\nThank you for reporting this issue! The behavior you described with `useEffect` and `useRef` cleanup in React 19.1 is indeed unexpected and could signal a regression. Checking for `null` refs is a good workaround, but this scenario should ideally be handled gracefully by React itself.\n\nI reviewed your reproduction steps and the CodeSandbox link, and the issue seems to be reproducible consistently. It would be helpful to include the specific React version you were using in your tests. Additionally, providing information about the environment (e.g., browser, Node.js version) could further assist in diagnosing this issue.\n\nIt might also be worth investigating whether this behavior is related to any recent changes in React's lifecycle management. I recommend tagging this issue with `Component: Hooks` or reaching out to maintainers who have worked on related features.\n\nLooking forward to seeing a resolution for this!\n\n",
"created_at": "2025-04-18T10:43:38Z",
"id": 2815228005,
"updated_at": "2025-04-18T10:43:38Z",
"user": "MunawarAbbas313"
}
] |
facebook/react | 32,942 | Bug: | open | ghost | <!--
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
| 0 | 2025-04-17T02:12:45 | 2025-04-17T02:12:45 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,927 | Bug: Uncaught TypeError: Cannot read properties of undefined (reading 'H') | open | dfsfyt | When I'm debugging in a local project with react source code, it reports an error
1. yarn create vite react-debugger --template react
2. git clone https://github.com/facebook/react.git
3. copy react/packages/* to react-debugger/src/react
4. change vite.config.js
```js
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
// 配置别名
alias: {
react: path.posix.resolve("src/react/packages/react"),
"react-dom": path.posix.resolve("src/react/packages/react-dom"),
"react-client": path.posix.resolve("src/react/packages/react-client"),
"react-dom-bindings": path.posix.resolve(
"src/react/packages/react-dom-bindings"
),
"react-reconciler": path.posix.resolve(
"src/react/packages/react-reconciler"
),
scheduler: path.posix.resolve("src/react/packages/scheduler"),
shared: path.posix.resolve("src/react/packages/shared"),
"dom-event-testing-library": path.posix.resolve("src/react/packages/dom-event-testing-library"),
"eslint-plugin-react-hooks": path.posix.resolve("src/react/packages/eslint-plugin-react-hooks"),
"internal-test-utils": path.posix.resolve("src/react/packages/internal-test-utils"),
"jest-react": path.posix.resolve("src/react/packages/jest-react"),
"react-art": path.posix.resolve("src/react/packages/react-art"),
"react-cache": path.posix.resolve("src/react/packages/react-cache"),
"react-debug-tools": path.posix.resolve("src/react/packages/react-debug-tools"),
"react-tools": path.posix.resolve("src/react/packages/react-tools"),
"react-tools-core": path.posix.resolve("src/react/packages/react-tools-core"),
"react-tools-extensions": path.posix.resolve("src/react/packages/react-tools-extensions"),
"react-tools-fusebox": path.posix.resolve("src/react/packages/react-tools-fusebox"),
"react-tools-inline": path.posix.resolve("src/react/packages/react-tools-inline"),
"react-tools-shared": path.posix.resolve("src/react/packages/react-tools-shared"),
"react-tools-shell": path.posix.resolve("src/react/packages/react-tools-shell"),
"react-tools-timeline": path.posix.resolve("src/react/packages/react-tools-timeline"),
"react-is": path.posix.resolve("src/react/packages/react-is"),
"react-markup": path.posix.resolve("src/react/packages/react-markup"),
"react-native-renderer": path.posix.resolve("src/react/packages/react-native-renderer"),
"react-noop-renderer": path.posix.resolve("src/react/packages/react-noop-renderer"),
"react-refresh": path.posix.resolve("src/react/packages/react-refresh"),
"react-server": path.posix.resolve("src/react/packages/react-server"),
"react-server-dom-esm": path.posix.resolve("src/react/packages/react-server-dom-esm"),
"react-server-dom-fb": path.posix.resolve("src/react/packages/react-server-dom-fb"),
"react-server-dom-parcel": path.posix.resolve("src/react/packages/react-server-dom-parcel"),
"react-server-dom-turbopack": path.posix.resolve("src/react/packages/react-server-dom-turbopack"),
"react-server-dom-webpack": path.posix.resolve("src/react/packages/react-server-dom-webpack"),
"react-suspense-test-utils": path.posix.resolve("src/react/packages/react-suspense-test-utils"),
"react-text-renderer": path.posix.resolve("src/react/packages/react-text-renderer"),
"use-subscription": path.posix.resolve("src/react/packages/use-subscription"),
"use-sync-external-store": path.posix.resolve("src/react/packages/use-sync-external-store"),
},
},
// 配置环境变量,解决__DEV__ is not defined
define: {
__DEV__: false, // 设置为false跳过 if(__dev__)的开发逻辑 这样会报错 需要修改jsx_dev的引入
__EXPERIMENTAL__: true,
__PROFILE__: true,
},
});
```
5. jsconfig.json
```js
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"react/*": ["src/react/packages/react/*"],
"react-dom/*": ["src/react/packages/react-dom/*"],
"react-client/*": ["src/react/packages/react-client/*"],
"react-dom-bindings/*": ["src/react/packages/react-dom-bindings/*"],
"react-reconciler/*": ["src/react/packages/react-reconciler/*"],
"scheduler/*": ["src/react/packages/scheduler/*"],
"shared/*": ["src/react/packages/shared/*"],
"dom-event-testing-library/*":["src/react/packages/dom-event-testing-library"],
"eslint-plugin-react-hooks/*":["src/react/packages/eslint-plugin-react-hooks"],
"internal-test-utils/*":["src/react/packages/internal-test-utils"],
"jest-react/*":["src/react/packages/jest-react"],
"react-art/*":["src/react/packages/react-art"],
"react-cache/*":["src/react/packages/react-cache"],
"react-debug-tools/*":["src/react/packages/react-debug-tools"],
"react-tools/*":["src/react/packages/react-tools"],
"react-tools-core/*":["src/react/packages/react-tools-core"],
"react-tools-extensions/*":["src/react/packages/react-tools-extensions"],
"react-tools-fusebox/*":["src/react/packages/react-tools-fusebox"],
"react-tools-inline/*":["src/react/packages/react-tools-inline"],
"react-tools-shared/*":["src/react/packages/react-tools-shared"],
"react-tools-shell/*":["src/react/packages/react-tools-shell"],
"react-tools-timeline/*":["src/react/packages/react-tools-timeline"],
"react-is/*":["src/react/packages/react-is"],
"react-markup/*":["src/react/packages/react-markup"],
"react-native-renderer/*":["src/react/packages/react-native-renderer"],
"react-noop-renderer/*":["src/react/packages/react-noop-renderer"],
"react-refresh/*":["src/react/packages/react-refresh"],
"react-server/*":["src/react/packages/react-server"],
"react-server-dom-esm/*":["src/react/packages/react-server-dom-esm"],
"react-server-dom-fb/*":["src/react/packages/react-server-dom-fb"],
"react-server-dom-parcel/*":["src/react/packages/react-server-dom-parcel"],
"react-server-dom-turbopack/*":["src/react/packages/react-server-dom-turbopack"],
"react-server-dom-webpack/*":["src/react/packages/react-server-dom-webpack"],
"react-suspense-test-utils/*":["src/react/packages/react-suspense-test-utils"],
"react-text-renderer/*":["src/react/packages/react-text-renderer"],
"use-subscription/*":["src/react/packages/use-subscription"],
"use-sync-external-store/*":["src/react/packages/use-sync-external-store"],
}
},
"exclude": ["node_modules", "dist"]
}
```
6. yarn add flow-remove-types -D
7. npx flow-remove-types --out-dir src/react src/react
8. change react-debugger/src/react/packages/react-reconciler/src/ReactFiberConfig.js to
```js
// throw new Error('This module must be shimmed by a specific renderer.');
export * from "./forks/ReactFiberConfig.dom"
```
9. npm run dev
### erro happened,like the below picture:
<img width="661" alt="Image" src="https://github.com/user-attachments/assets/0778709b-5a64-4030-8e0d-00f09ca30f78" />
代码地址:
https://github.com/dfsfyt/react-debugger | 0 | 2025-04-16T11:27:09 | 2025-04-16T11:27:09 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,926 | Bug: | closed | jasonsgitsit | <!--
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
| 0 | 2025-04-16T06:22:48 | 2025-04-16T22:02:13 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,915 | [Compiler Bug]: Unicode characters handled incorrectly | open | JCown | ### 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/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNv3H5F+ADxcAwhAC22OgjoFcGXAF5RIAO4JKcLQnyBeDcDSO2fwB6AHwL8ggNziAvuJBulg4BDZ0YATqWjp6BMb4-JgwEJhgwsbuIl5SMjBsyoRMAG7uwClpYAB0hui4-g6Oyq7FZQEg-kA
### Repro steps
When passing a unicode character as a prop, like `<MyComponent text="welcome 👋" />` then in RC output code we can see `<MyComponent text="welcome \uD83D\uDC4B" />` - unicode character gets replaced by "stringified" UTF-16 representation of it.
**Expected result (on the screen)**
Welcome 👋
**Actual result:**
Welcome \uD83D\uDC4B
### How often does this bug happen?
Every time
### What version of React are you using?
19.1
### What version of React Compiler are you using?
19.0.0-beta-ebf51a3-20250411 | 0 | 2025-04-15T13:53:26 | 2025-04-16T03:33:28 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [] |
facebook/react | 32,899 | Bug: | closed | mhmadsaleh-0 | <!--
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
| 0 | 2025-04-15T02:46:41 | 2025-04-15T07:47:14 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,867 | Bug: | closed | cheongai2024 | <!--
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
| 1 | 2025-04-13T12:39:01 | 2025-04-15T17:10:23 | [
"Status: Unconfirmed"
] | [
{
"body": "Hey 👋",
"created_at": "2025-04-14T13:00:34Z",
"id": 2801638165,
"updated_at": "2025-04-14T13:00:34Z",
"user": "bbygamer"
}
] |
facebook/react | 32,866 | Bug: | closed | cheongai2024 | <!--
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
| 0 | 2025-04-13T12:38:59 | 2025-04-15T17:10:09 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,857 | Test Issue from GitHub MCP Server | closed | LalaIAm | This is a test issue created to demonstrate the GitHub MCP server capabilities. Please disregard. | 0 | 2025-04-11T19:19:46 | 2025-04-12T08:13:55 | [] | [] |
facebook/react | 32,854 | Bug: button not working | closed | prwkhar | <!--
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
| 0 | 2025-04-11T15:06:09 | 2025-04-11T15:11:01 | [
"Status: Unconfirmed"
] | [] |
facebook/react | 32,852 | [DevTools Bug] Cannot add node "909" because a node with that id is already in the Store. | open | IvanGoranov02 | ### Website or app
Error
### Repro steps
Cannot see
### How often does this bug happen?
Every time
### DevTools package (automated)
react-devtools-extensions
### DevTools version (automated)
6.1.1-44c3d3d665
### Error message (automated)
Cannot add node "909" because a node with that id is already in the Store.
### Error call stack (automated)
```text
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1192232
at v.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1160378)
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1161985
at bridgeListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1572692)
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react
``` | 5 | 2025-04-11T11:56:38 | 2025-04-18T07:24:58 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1192232\n at v.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1160378)\n at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1161985\n at bridgeListener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:1:1572692)",
"created_at": "2025-04-14T10:11:26Z",
"id": 2801207133,
"updated_at": "2025-04-14T10:11:26Z",
"user": "JOBAYERAHAMED00"
},
{
"body": "same here! its happening ",
"created_at": "2025-04-15T14:42:57Z",
"id": 2805596822,
"updated_at": "2025-04-15T14:42:57Z",
"user": "csalazarPD"
},
{
"body": "+1 This started happening to me today.",
"created_at": "2025-04-15T15:53:53Z",
"id": 2806538024,
"updated_at": "2025-04-15T15:53:53Z",
"user": "vegerot"
},
{
"body": "just happened now",
"created_at": "2025-04-16T13:18:45Z",
"id": 2809567702,
"updated_at": "2025-04-16T13:18:45Z",
"user": "LennyLouis"
},
{
"body": "Any updates ?",
"created_at": "2025-04-18T07:24:57Z",
"id": 2814776668,
"updated_at": "2025-04-18T07:24:57Z",
"user": "pranavmappoli"
}
] |
facebook/react | 32,836 | [DevTools Bug]: Firefox devtools extension doesn't work with React 19 | open | shardul-b | ### Website or app
https://vite.new/react
### Repro steps
I am using React 19 for my project and when I tried to access the components and profiler in Firefox. I got the following message:
```
Unsupported React version detected
This version of React DevTools supports React DOM v15+ and React Native v61+.
In order to use DevTools with an older version of React, you'll need to [install an older version of the extension](https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back).
```
However the same works in Chrome with Devtools version: `6.1.1 (2/7/2025)`
I have provided a sample project from the vite react template where this could be reproduced (as I was working on localhost) [stackblitz link](https://stackblitz.com/edit/vitejs-vite-8a1t8yxc?file=index.html&terminal=dev)
Screenshot:
<img width="409" alt="Image" src="https://github.com/user-attachments/assets/79f96d1c-7332-48cf-9cf8-d5663ac37ce5" />
### How often does this bug happen?
Every time
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 1 | 2025-04-09T13:49:06 | 2025-04-10T12:52:41 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "This could be related to:\n\n1. https://github.com/facebook/react/issues/17033\n2. https://github.com/facebook/react/issues/32771",
"created_at": "2025-04-09T13:50:24Z",
"id": 2789809474,
"updated_at": "2025-04-09T13:50:24Z",
"user": "shardul-b"
}
] |
facebook/react | 32,835 | [DevTools Bug]: symbolicated sourcemaps won't fetch for rsc components on Chrome 135.0.7 (rsc:// and webpack:// prefixed fetches fail) | open | jamiesunderland | ### Website or app
localhost:3000
### Repro steps
Download latest chrome (135.0.7049.85). Tested on Apple Silicon.
Start fresh next project (15.2.3+).
fileFetcher will fail to fetch resources when you inspect the default page.tsx component.
This is a really annoying bug because it ends up giving the unsymbolicated source map line number + column number, which is deceptive.
```
fileFetcher.js:1 Fetch API cannot load rsc://React/Server/webpack-internal:///(rsc)/app/page.tsx?19. URL scheme "rsc" is not supported.
fileFetcher.js:1 Fetch API cannot load webpack-internal:///(app-pages-browser)/node_modules/next/dist/client/image-component.js. URL scheme "webpack-internal" is not supported.
```
Would love for _debugSource to come back 😢
### How often does this bug happen?
Every time
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 0 | 2025-04-09T05:45:53 | 2025-04-09T05:59:11 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [] |
facebook/react | 32,824 | Bug: irregular behaviour of sidescroll when webpage zoomed-in | open | AnimeshKumar923 | React version: _NA_
## System details:
- Ubuntu 24.04.2 LTS
- Google Chrome _[Version 134.0.6998.88 (Official Build) (64-bit)]_
## Screen recording
https://github.com/user-attachments/assets/23be8b42-e362-435f-9946-dbe217f56958
## Steps To Reproduce
1. Go to this [docs link](https://react.dev/learn/state-a-components-memory) on Chrome browser
2. Make browser full-screen.
3. Zoom-in page to 110% and check the [code illustration](https://react.dev/learn/state-a-components-memory#when-a-regular-variable-isnt-enough)
Link to code example: _NA_
## The current behavior
The codesandbox preview being rendered should not fluctuate as you can see in the screen recording. The preview fluctuates in 110% zoom level, but when I revert it back to 100% it remains static.
## The expected behavior
The preview being rendered should remain static as in any other zoom levels | 3 | 2025-04-06T05:58:46 | 2025-04-15T12:54:39 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi, @AnimeshKumar923 I am contributing for first time and would like to work on this issue. Could I give a try?",
"created_at": "2025-04-07T18:52:10Z",
"id": 2784263506,
"updated_at": "2025-04-07T18:52:10Z",
"user": "shahriya1995"
},
{
"body": "@shahriya1995 Yes, you can. But before working on it, can you provide your approach on how you're going to solve it?",
"created_at": "2025-04-08T04:16:18Z",
"id": 2785178291,
"updated_at": "2025-04-08T04:16:18Z",
"user": "AnimeshKumar923"
},
{
"body": "Couldn't reproduce, but this should be fixable using [scrollbar-gutter](https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter) css property ",
"created_at": "2025-04-15T12:54:38Z",
"id": 2804959530,
"updated_at": "2025-04-15T12:54:38Z",
"user": "Amirali-Amirifar"
}
] |
facebook/react | 32,818 | Bug: Sidebar Dropdown Does Not Collapse on Second Click in React Documentation | open | SahilPatel2003 | In the official React documentation, when I click on the dropdown button (▾) for a topic in the sidebar, it expands as expected. However, clicking on the same dropdown again does not collapse the section.
It only collapses when I click on another topic’s dropdown, which is inconsistent behavior and confusing from a UX perspective.
React version: 19.1
## Steps To Reproduce
1. Go to the [React documentation](https://react.dev/).
2. Click on any dropdown (e.g., "Learn React" or "API Reference") in the left sidebar to expand it.
3. Click again on the same dropdown.
4. Observe that the dropdown does not collapse.
5. Click on a different dropdown.
6. Observe that the previous one collapses.
<!--
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://react.dev/reference/react/hooks
<!--
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
Clicking on the same dropdown icon does not collapse the section.
The only way to collapse a section is to open a different section.
## The expected behavior
Clicking on the same dropdown icon should toggle (expand/collapse) the section.
This behavior is expected and more intuitive for users.

| 5 | 2025-04-04T10:22:04 | 2025-04-15T09:19:16 | [
"Status: Unconfirmed"
] | [
{
"body": "Hi! I was able to reproduce this issue in React 19.1. I'd love to work on fixing it. Could you assign this to me?",
"created_at": "2025-04-04T15:23:04Z",
"id": 2779064671,
"updated_at": "2025-04-04T15:23:04Z",
"user": "Sanyam2511"
},
{
"body": "Hey! If no one is working on this, could you assign this to me? I am pretty sure I can fix this one",
"created_at": "2025-04-04T15:35:15Z",
"id": 2779108750,
"updated_at": "2025-04-04T15:35:15Z",
"user": "AfnanFerdousi"
},
{
"body": "Hii, sharp insight. Allow me to resolve this issue just by altering state of a variable using react hook useState. Could you please authorize my access to the repository? ",
"created_at": "2025-04-04T18:29:57Z",
"id": 2779479201,
"updated_at": "2025-04-04T18:29:57Z",
"user": "Pankaj-70"
},
{
"body": "Hi @SahilPatel2003,\nSharp observation! I’d love to contribute and resolve this issue.",
"created_at": "2025-04-05T13:29:55Z",
"id": 2780725348,
"updated_at": "2025-04-05T13:29:55Z",
"user": "amankumarnayak"
},
{
"body": "@SahilPatel2003 \n\nThis is the wrong repository to open this issue — it should’ve been on [react.dev](https://github.com/reactjs/react.dev).\n\nNo worries though, feel free to open it there. In fact, there's already an existing issue discussing it.\n\nAlso, this is a feature, not a bug! I don't have the link to the previous issue that explains why it works this way, but it does. 🙂",
"created_at": "2025-04-15T09:19:15Z",
"id": 2804395211,
"updated_at": "2025-04-15T09:19:15Z",
"user": "ajuchacko"
}
] |
facebook/react | 32,811 | Bug: createRoot().render() is not fully synchronous unless wrapped in flushSync, unlike legacy ReactDOM.render | closed | jukben | <!--
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.2.0 (reproduced in latest 19.1 as well)
---
## Summary
There is [an open issue](https://github.com/reactjs/react.dev/issues/7317) proposing documentation updates around the use of `flushSync` with `createRoot().render()` to enforce synchronous rendering. However, since that issue has gone without feedback for several months, and given the core behavior observed, I suspect this may be an actual bug in React rather than just a documentation gap. I'm opening this issue here in the main React repository to clarify whether this behavior is intentional or not.
---
## Steps To Reproduce
1. Render a basic React app using `createRoot(...).render(<App />)`.
2. Inside `<App />`, log messages from `useLayoutEffect` and `useEffect`.
3. Log messages before and after `root.render()` call.
4. Compare behavior between:
- `createRoot(...).render(...)` (modern API)
- `flushSync(() => root.render(...))`
- Legacy `ReactDOM.render(...)`
---
**Link to code example:** [CodeSandbox](https://codesandbox.io/p/sandbox/react-and-synchronous-react-render-jkpcz7?file=%2Fsrc%2Findex.js)
---
## The current behavior
Using `createRoot(...).render(...)` without wrapping in `flushSync`, we observe that:
- The log inside `useLayoutEffect` is emitted **after** `console.log("Post root.render")`, indicating the effect happens *after* the render call resolves.
- In contrast, using `flushSync(() => root.render(...))` or legacy `ReactDOM.render(...)`, `useLayoutEffect` is called *before* the post-render log.
This suggests the modern root API allows post-render behavior to interleave with layout effects, even outside of explicitly opted-in concurrent features. This might violate expectations around synchronous behavior of the initial render.
---
## The expected behavior
As [@rickhanlonii](https://github.com/rickhanlonii) noted in a related discussion, the initial render should be synchronous by default. If that’s the case, this behavior seems inconsistent.
- `createRoot(...).render(...)` should preserve layout effect timing consistency with legacy `ReactDOM.render(...)`, without needing to wrap in `flushSync`.
- If the current behavior is intentional, it would help to explicitly document that `createRoot(...).render(...)` may be async under certain conditions—even without concurrent features being enabled.
| 2 | 2025-04-03T12:19:08 | 2025-04-08T11:44:14 | [
"Status: Unconfirmed"
] | [
{
"body": "Once we start rendering, it's synchronous. But the actual `render()` call is not and always runs in the next microtask. It's the same as `setState` in that regard.\n\nWe can document in caveats under https://react.dev/reference/react-dom/client/createRoot#root-render. Could you file a PR making these changes? Similar for `hydrateRoot`",
"created_at": "2025-04-03T13:06:08Z",
"id": 2775729396,
"updated_at": "2025-04-03T13:06:08Z",
"user": "eps1lon"
},
{
"body": "Hey @eps1lon thanks a lot for clarifying! I put together this draft, could you take a look https://github.com/reactjs/react.dev/pull/7717",
"created_at": "2025-04-04T08:53:09Z",
"id": 2777986728,
"updated_at": "2025-04-04T08:53:09Z",
"user": "jukben"
}
] |
facebook/react | 32,806 | Bug: stylesheets that use precedence are significantly slower to render at scale | open | RJWadley | <!--
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, 19.1.0
## Steps To Reproduce
1. Render at least two precedence levels, for example 'a' and 'b' so that react can insert our stylesheets into the head rather than inline.
2. Render lots of style elements into 'a' (your first precedence level, the important part is that react inserts our stylesheets into the head) and observe performance. Compare this to rendering without any precedence at all.
<!--
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.
-->
Here's a codesandbox demonstrating the basic issue:
https://codesandbox.io/p/sandbox/react-style-perf-t7w9qr
Or a github repository, if you prefer:
https://github.com/RJWadley/react-style-perf
## The current behavior
Seems like each style tag is handled independently with very little optimization - which is probably fine if you only load one or two stylesheets but doesn't work well for larger amounts of styling. In the attached example, you should also notice that every time we toggle our styles with precedence our performance gets worse and worse.
<details>
<summary>
Here's a real example of render performance on my M1 mac pro. This isn't from the attached example, but is the same issue just at a larger scale:
</summary>
<img width="759" alt="Image" src="https://github.com/user-attachments/assets/70a25e71-7d83-491d-8804-e5eace03b1e4" />
Zooming in, most of the performance hit seems to come from query selectors and from actually inserting each stylesheet.
<img width="1497" alt="Image" src="https://github.com/user-attachments/assets/393c6d5a-c338-4ad5-801e-395851ebaab5" />
</details>
## The expected behavior
Stylesheets should ideally render in similar time regardless of precedence.
Related: https://github.com/facebook/react/issues/30739 | 3 | 2025-04-02T16:49:59 | 2025-04-03T20:56:08 | [
"Status: Unconfirmed"
] | [
{
"body": "Is this flamegraph from dev or prod? If it's only dev, could you also compare performance in prod?\n\nCould you also include timing comparisons between precedence and no precedence?",
"created_at": "2025-04-03T06:08:11Z",
"id": 2774588102,
"updated_at": "2025-04-03T06:08:11Z",
"user": "eps1lon"
},
{
"body": "We've (at @mui) have also come to a similar conclusion that the current implementation of of style hoisting (mainly on the client side) is rather slow pertaining to the `dom` querying that occurs to hoist each style tag.\nI was able to improve the perf on the client side with this [patch](https://github.com/brijeshb42/test-styling-engine/blob/main/patches/react-dom.patch) by a factor of 17 in a test of rendering 10000 different components with a `style` tag having both `href` and `precedence`.\nReact v19 took `3659.1043ms` to append the dom items vs `215.73ms` with the patch. Note that the patch is fully client side and does not consider hydration or RSC. So I am sure this isn't a proper solution, just something in the right direction.\n\n\n",
"created_at": "2025-04-03T11:24:27Z",
"id": 2775446855,
"updated_at": "2025-04-03T11:24:27Z",
"user": "brijeshb42"
},
{
"body": "@eps1lon the attached flamegraph is from a production next.js build with mangling disabled.\n\nSome timings:\n\n#### On A Production Site\nThe above patch does seem to help. It seems to have some issues with SSR though.\nstable react: 4.5s\npatched react: 97.88ms\n\nWhen I remove precedence the site gets much slower, likely due to the massively increased DOM size. Still, \nstable react, no precedence: 698.64 ms\npatched react, no precedence: 904.13 ms\n\n\n#### Within Codesandbox Reproduction\nIn the attached codesandbox example with the letters, I've observed this with mid-tier mobile CPU throttling:\nNo precedence: 1.01s\nWith precedence, first render: 5.65s\n\nBecause we're adding more and more to the DOM our performance will decrease over time. For example, when rerunning the letters example with precedence, a second render took 15.31s and our third took 26.88s",
"created_at": "2025-04-03T20:56:06Z",
"id": 2776900426,
"updated_at": "2025-04-03T20:56:06Z",
"user": "RJWadley"
}
] |
facebook/react | 32,805 | [DevTools Bug]: | closed | rayan2005643 | ### Website or app
https://github.com/facebook/react/issues/new/choose
### Repro steps
1. ****
### How often does this bug happen?
Often
### DevTools package (automated)
_No response_
### DevTools version (automated)
_No response_
### Error message (automated)
_No response_
### Error call stack (automated)
```text
```
### Error component stack (automated)
```text
```
### GitHub query string (automated)
```text
``` | 1 | 2025-04-02T12:51:20 | 2025-04-02T18:08:14 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Developer Tools"
] | [
{
"body": "Hi\n",
"created_at": "2025-04-02T14:35:23Z",
"id": 2772768165,
"updated_at": "2025-04-02T14:35:23Z",
"user": "rayan2005643"
}
] |
facebook/react | 32,804 | [Bug]: ERR_INVALID_ARG_TYPE occurs when I install project | closed | SongMinQQ | ### 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)
- [ ] eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- [x] react-compiler-healthcheck (build issue installing or using the healthcheck script)
### Link to repro
none. basic React template
### Repro steps
When I install my project in local environment, this error is occured.
`
12 verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
12 verbose stack at normalizeSpawnArguments (node:child_process:539:3)
12 verbose stack at spawn (node:child_process:746:13)
12 verbose stack at promiseSpawn (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:39:16)
12 verbose stack at spawnWithShell (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
12 verbose stack at promiseSpawn (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
12 verbose stack at runScriptPkg (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
12 verbose stack at runScript (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
12 verbose stack at #run (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\commands\run-script.js:131:13)
12 verbose stack at async RunScript.exec (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\commands\run-script.js:40:7)
12 verbose stack at async Npm.exec (C:\Users\koe73\AppData\Local\nvm\v22.14.0\node_modules\npm\lib\npm.js:208:9)
13 error code ERR_INVALID_ARG_TYPE
14 error The "file" argument must be of type string. Received undefined
15 verbose cwd C:\Users\koe73\OneDrive\바탕 화면\app
16 verbose os Windows_NT 10.0.19045
17 verbose node v22.14.0
18 verbose npm v11.2.0
19 verbose exit 1
20 verbose code 1
`
I've tried several things so far:
Uninstalling and reinstalling Node.js
Updating npm
Switching to a Vite project
Deleting npm cathe
Before I started getting this error, I was using Node.js version 18.17.1.
When I switch back to 18.17.1, the error doesn't occur.
But I really want to use the latest LTS version...
Help me plz..
### How often does this bug happen?
Every time
### What version of React are you using?
19.0.0
### What version of React Compiler are you using?
Node.Js 22.14.0(lts) | 3 | 2025-04-02T04:38:51 | 2025-04-02T14:02:20 | [
"Type: Bug",
"Status: Unconfirmed",
"Component: Optimizing Compiler"
] | [
{
"body": "Since I'm not using Windows, I can't confirm exactly, but it seems the error occurred because the Korean word '바탕화면' (Desktop) is in the file path. This is a common error when running Node on Windows, though I'm not entirely sure.",
"created_at": "2025-04-02T04:53:09Z",
"id": 2771336465,
"updated_at": "2025-04-02T04:53:09Z",
"user": "koreanddinghwan"
},
{
"body": "Hello!\nIt seems that as @koreanddinghwan mentioned, the error is coming from the filepath.\n\nWhat \"react basic template\" are you using?\n\nPlease try creating a new template using Vite or another bundler. I suggest you use the following command from the Vite documentation:\n\n````bash\nnpm create vite@latest my-react-app -- --template react\n````\n\nThen navigate to the project's directory, install && run the application.\n````bash\ncd my-react-app\nnpm install\nnpm run dev\n````\nI've just tested this and it's working fine, let me know if worked for you as well.",
"created_at": "2025-04-02T13:15:55Z",
"id": 2772535072,
"updated_at": "2025-04-02T13:15:55Z",
"user": "sergiotales1"
},
{
"body": "I found the cause of the problem and fixed it temporarily.\n\nThank you for your help and advice!!😆\n\nhttps://github.com/npm/cli/pull/8205",
"created_at": "2025-04-02T13:59:46Z",
"id": 2772658656,
"updated_at": "2025-04-02T14:01:36Z",
"user": "SongMinQQ"
}
] |
There are more files in https://huggingface.co/datasets/FlameF0X/Proto-2.1/tree/main Have fun training a LM. You also have https://huggingface.co/datasets/FlameF0X/Proto-2