mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +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:
1 parent
dc3178151b
commit
f0e808e5bc
5 files changed
+2096
-979
No files matched your search
@@ -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