@@ -190,9 +190,7 @@ function performReactRefresh() {
190190 failedRootsSnapshot . forEach ( ( root ) => {
191191 const helpers = helpersByRootSnapshot . get ( root )
192192 if ( helpers === undefined ) {
193- throw new Error (
194- 'Could not find helpers for a root. This is a bug in React Refresh.' ,
195- )
193+ throw new Error ( 'Could not find helpers for a root. This is a bug in React Refresh.' )
196194 }
197195 if ( ! failedRoots . has ( root ) ) {
198196 // No longer failed.
@@ -217,9 +215,7 @@ function performReactRefresh() {
217215 mountedRootsSnapshot . forEach ( ( root ) => {
218216 const helpers = helpersByRootSnapshot . get ( root )
219217 if ( helpers === undefined ) {
220- throw new Error (
221- 'Could not find helpers for a root. This is a bug in React Refresh.' ,
222- )
218+ throw new Error ( 'Could not find helpers for a root. This is a bug in React Refresh.' )
223219 }
224220 if ( ! mountedRoots . has ( root ) ) {
225221 // No longer mounted.
@@ -405,8 +401,7 @@ export function injectIntoGlobalHook(globalObject) {
405401 alternate . memoizedState . element != null &&
406402 mountedRoots . has ( root )
407403
408- const isMounted =
409- current . memoizedState != null && current . memoizedState . element != null
404+ const isMounted = current . memoizedState != null && current . memoizedState . element != null
410405
411406 if ( ! wasMounted && isMounted ) {
412407 // Mount a new root.
@@ -481,10 +476,7 @@ export function createSignatureFunctionForTransform() {
481476 // Set the signature for all types (even wrappers!) in case
482477 // they have no signatures of their own. This is to prevent
483478 // problems like https://github.com/facebook/react/issues/20417.
484- if (
485- type != null &&
486- ( typeof type === 'function' || typeof type === 'object' )
487- ) {
479+ if ( type != null && ( typeof type === 'function' || typeof type === 'object' ) ) {
488480 setSignature ( type , key , forceReset , getCustomHooks )
489481 }
490482 return type
@@ -578,10 +570,7 @@ export function registerExportsForReactRefresh(filename, moduleExports) {
578570 register ( exportValue , filename + ' export ' + key )
579571 } else if ( isCompoundComponent ( exportValue ) ) {
580572 for ( const subKey in exportValue ) {
581- register (
582- exportValue [ subKey ] ,
583- filename + ' export ' + key + '-' + subKey ,
584- )
573+ register ( exportValue [ subKey ] , filename + ' export ' + key + '-' + subKey )
585574 }
586575 }
587576 }
@@ -604,28 +593,12 @@ const enqueueUpdate = debounce(async () => {
604593 performReactRefresh ( )
605594} , 16 )
606595
607- export function validateRefreshBoundaryAndEnqueueUpdate (
608- id ,
609- prevExports ,
610- nextExports ,
611- ) {
596+ export function validateRefreshBoundaryAndEnqueueUpdate ( id , prevExports , nextExports ) {
612597 const ignoredExports = window . __getReactRefreshIgnoredExports ?. ( { id } ) ?? [ ]
613- if (
614- predicateOnExport (
615- ignoredExports ,
616- prevExports ,
617- ( key ) => key in nextExports ,
618- ) !== true
619- ) {
598+ if ( predicateOnExport ( ignoredExports , prevExports , ( key ) => key in nextExports ) !== true ) {
620599 return 'Could not Fast Refresh (export removed)'
621600 }
622- if (
623- predicateOnExport (
624- ignoredExports ,
625- nextExports ,
626- ( key ) => key in prevExports ,
627- ) !== true
628- ) {
601+ if ( predicateOnExport ( ignoredExports , nextExports , ( key ) => key in prevExports ) !== true ) {
629602 return 'Could not Fast Refresh (new export)'
630603 }
631604
0 commit comments