( renderFunction: (Props, Ref) => React$Node, props: Props, ref: Ref, currentDispatcher: CurrentDispatcherRef, )
| 1254 | } |
| 1255 | |
| 1256 | function inspectHooksOfForwardRef<Props, Ref>( |
| 1257 | renderFunction: (Props, Ref) => React$Node, |
| 1258 | props: Props, |
| 1259 | ref: Ref, |
| 1260 | currentDispatcher: CurrentDispatcherRef, |
| 1261 | ): HooksTree { |
| 1262 | const previousDispatcher = currentDispatcher.H; |
| 1263 | let readHookLog; |
| 1264 | currentDispatcher.H = DispatcherProxy; |
| 1265 | let ancestorStackError; |
| 1266 | try { |
| 1267 | ancestorStackError = new Error(); |
| 1268 | renderFunction(props, ref); |
| 1269 | } catch (error) { |
| 1270 | handleRenderFunctionError(error); |
| 1271 | } finally { |
| 1272 | readHookLog = hookLog; |
| 1273 | hookLog = []; |
| 1274 | currentDispatcher.H = previousDispatcher; |
| 1275 | } |
| 1276 | const rootStack = |
| 1277 | ancestorStackError === undefined |
| 1278 | ? ([]: ParsedStackFrame[]) |
| 1279 | : ErrorStackParser.parse(ancestorStackError); |
| 1280 | return buildTree(rootStack, readHookLog); |
| 1281 | } |
| 1282 | |
| 1283 | function resolveDefaultProps(Component: any, baseProps: any) { |
| 1284 | if (Component && Component.defaultProps) { |
no test coverage detected