mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Debug Tools] Always use includeHooksSource option (#28309)
This option was added defensively but it's not needed. There's no cost to including it always. I suspect this optional was added mainly to avoid needing to update tests. That's not a reason to have an unnecessary public API though. We have a praxis for dealing with source location in tests to avoid them failing tests. I also ported them to inline snapshots so that additions to the protocol isn't such a pain.
This commit is contained in:
@@ -3301,7 +3301,6 @@ export function attach(
|
||||
hooks = inspectHooksOfFiber(
|
||||
fiber,
|
||||
(renderer.currentDispatcherRef: any),
|
||||
true, // Include source location info for hooks
|
||||
);
|
||||
} finally {
|
||||
// Restore original console functionality.
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('parseHookNames', () => {
|
||||
});
|
||||
|
||||
async function getHookNamesForComponent(Component, props = {}) {
|
||||
const hooksTree = inspectHooks(Component, props, undefined, true);
|
||||
const hooksTree = inspectHooks(Component, props, undefined);
|
||||
const hookNames = await parseHookNames(hooksTree);
|
||||
return hookNames;
|
||||
}
|
||||
@@ -928,7 +928,7 @@ describe('parseHookNames worker', () => {
|
||||
});
|
||||
|
||||
async function getHookNamesForComponent(Component, props = {}) {
|
||||
const hooksTree = inspectHooks(Component, props, undefined, true);
|
||||
const hooksTree = inspectHooks(Component, props, undefined);
|
||||
const hookNames = await parseHookNames(hooksTree);
|
||||
return hookNames;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user