Skip to content

Commit 93ea7d1

Browse files
authored
fix: update fiber renderData for both function and object types (#354)
1 parent 21ce6ce commit 93ea7d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/scan/src/core/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export const getLabelText = (
169169
export const updateFiberRenderData = (fiber: Fiber, renders: Array<Render>) => {
170170
ReactScanInternals.options.value.onRender?.(fiber, renders);
171171
const type = getType(fiber.type) || fiber.type;
172-
if (type && typeof type === 'function' && typeof type === 'object') {
172+
if (type && (typeof type === 'function' || typeof type === 'object')) {
173173
const renderData = (type.renderData || {
174174
count: 0,
175175
time: 0,

0 commit comments

Comments
 (0)