-
Couldn't load subscription status.
- Fork 49.7k
Closed
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
On actions that cause a component to remount (e.g. changing a value of a hook inside the component), the devtools source field disappears.
Screen.Recording.2023-08-28.at.19.45.09.mov
React version: 18.2.0
Steps To Reproduce
- Clone this repo: https://github.com/idango10/fiber-debug-source-issue (simple project made with
create-react-app, only difference issrc/App.jsandsrc/Comp.js. - Open
devtools->Components, and navigate to theComp. - Verify that the source field exists.
- Change the value of the hook (e.g. from
'initial value'to'new value') and save the file. - Go back to the browser. and navigate back to the
Compindevtools. - You'll see that the source field vanished.
Code example:
Let's say I have two components:
export function InnerComp() {
const [value] = React.useState('initial value');
return <span>{value}</span>;
}import { InnerComp } from './InnerComp';
function OuterComp() {
return <InnerComp />;
}Looking at Comp in devtools -> Components, we'll see that there's a source field.
If I change 'initial value' to 'new value' inside useState of InnerComp:
export function InnerComp() {
const [value] = React.useState('new value');
return <span>{value}</span>;
}The source field of Comp will vanish.
The current behavior
The devtools source field of a component vanishes after remount.
The expected behavior
The field should stay visible.
plisovyi, VladyslavG, matangeorgi, ItayWix and vladyslav-baliuk
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug