File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
packages/scan/src/web/components/inspector/overlay Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 11import { FunctionComponentTag } from 'bippy' ;
2- import { type ComponentState } from 'react' ;
2+ import { Context , type ComponentState } from 'react' ;
33import { type Fiber } from 'react-reconciler' ;
44import { isEqual } from '~core/utils' ;
55
@@ -402,28 +402,13 @@ export const getCurrentContext = (fiber: Fiber) => {
402402 return contextObj ;
403403} ;
404404
405- const getContextDisplayName = ( contextType : unknown ) : string => {
406- if ( typeof contextType !== 'object' || contextType === null ) {
407- return String ( contextType ) ;
408- }
409-
410- return (
411- ( contextType as any ) ?. displayName ??
412- ( contextType as any ) ?. Provider ?. displayName ??
413- ( contextType as any ) ?. Consumer ?. displayName ??
414- ( contextType as any ) ?. type ?. name ?. replace ( 'Provider' , '' ) ??
415- 'Unnamed'
416- ) ;
417- } ;
418-
419405export const getChangedContext = ( fiber : Fiber ) : Set < string > => {
420406 const changes = new Set < string > ( ) ;
421407 if ( ! fiber . alternate ) return changes ;
422408
423409 const currentContexts = getAllFiberContexts ( fiber ) ;
424410
425- for ( const [ contextType ] of currentContexts ) {
426- const contextName = getContextDisplayName ( contextType ) ;
411+ for ( const [ contextName ] of currentContexts ) {
427412
428413 let searchFiber : Fiber | null = fiber ;
429414 let providerFiber : Fiber | null = null ;
You can’t perform that action at this time.
0 commit comments