@@ -21,6 +21,8 @@ export type ProfilerProps = {
21
21
includeRender ?: boolean ;
22
22
// If component updates should be displayed as spans. True by default.
23
23
includeUpdates ?: boolean ;
24
+ // Component that is being profiled.
25
+ children ?: React . ReactNode ;
24
26
// props given to component being profiled.
25
27
updateProps : { [ key : string ] : unknown } ;
26
28
} ;
@@ -120,7 +122,6 @@ class Profiler extends React.Component<ProfilerProps> {
120
122
}
121
123
122
124
public render ( ) : React . ReactNode {
123
- // eslint-disable-next-line react/prop-types
124
125
return this . props . children ;
125
126
}
126
127
}
@@ -136,7 +137,7 @@ class Profiler extends React.Component<ProfilerProps> {
136
137
function withProfiler < P extends Record < string , any > > (
137
138
WrappedComponent : React . ComponentType < P > ,
138
139
// We do not want to have `updateProps` given in options, it is instead filled through the HOC.
139
- options ?: Pick < Partial < ProfilerProps > , Exclude < keyof ProfilerProps , 'updateProps' > > ,
140
+ options ?: Pick < Partial < ProfilerProps > , Exclude < keyof ProfilerProps , 'updateProps' | 'children' > > ,
140
141
) : React . FC < P > {
141
142
const componentDisplayName =
142
143
( options && options . name ) || WrappedComponent . displayName || WrappedComponent . name || UNKNOWN_COMPONENT ;
0 commit comments