@@ -190,7 +190,9 @@ function performReactRefresh() {
190190 failedRootsSnapshot . forEach ( ( root ) => {
191191 const helpers = helpersByRootSnapshot . get ( root )
192192 if ( helpers === undefined ) {
193- throw new Error ( 'Could not find helpers for a root. This is a bug in React Refresh.' )
193+ throw new Error (
194+ 'Could not find helpers for a root. This is a bug in React Refresh.' ,
195+ )
194196 }
195197 if ( ! failedRoots . has ( root ) ) {
196198 // No longer failed.
@@ -215,7 +217,9 @@ function performReactRefresh() {
215217 mountedRootsSnapshot . forEach ( ( root ) => {
216218 const helpers = helpersByRootSnapshot . get ( root )
217219 if ( helpers === undefined ) {
218- throw new Error ( 'Could not find helpers for a root. This is a bug in React Refresh.' )
220+ throw new Error (
221+ 'Could not find helpers for a root. This is a bug in React Refresh.' ,
222+ )
219223 }
220224 if ( ! mountedRoots . has ( root ) ) {
221225 // No longer mounted.
@@ -401,7 +405,8 @@ export function injectIntoGlobalHook(globalObject) {
401405 alternate . memoizedState . element != null &&
402406 mountedRoots . has ( root )
403407
404- const isMounted = current . memoizedState != null && current . memoizedState . element != null
408+ const isMounted =
409+ current . memoizedState != null && current . memoizedState . element != null
405410
406411 if ( ! wasMounted && isMounted ) {
407412 // Mount a new root.
@@ -476,7 +481,10 @@ export function createSignatureFunctionForTransform() {
476481 // Set the signature for all types (even wrappers!) in case
477482 // they have no signatures of their own. This is to prevent
478483 // problems like https://github.com/facebook/react/issues/20417.
479- if ( type != null && ( typeof type === 'function' || typeof type === 'object' ) ) {
484+ if (
485+ type != null &&
486+ ( typeof type === 'function' || typeof type === 'object' )
487+ ) {
480488 setSignature ( type , key , forceReset , getCustomHooks )
481489 }
482490 return type
@@ -570,7 +578,10 @@ export function registerExportsForReactRefresh(filename, moduleExports) {
570578 register ( exportValue , filename + ' export ' + key )
571579 } else if ( isCompoundComponent ( exportValue ) ) {
572580 for ( const subKey in exportValue ) {
573- register ( exportValue [ subKey ] , filename + ' export ' + key + '-' + subKey )
581+ register (
582+ exportValue [ subKey ] ,
583+ filename + ' export ' + key + '-' + subKey ,
584+ )
574585 }
575586 }
576587 }
@@ -593,12 +604,28 @@ const enqueueUpdate = debounce(async () => {
593604 performReactRefresh ( )
594605} , 16 )
595606
596- export function validateRefreshBoundaryAndEnqueueUpdate ( id , prevExports , nextExports ) {
607+ export function validateRefreshBoundaryAndEnqueueUpdate (
608+ id ,
609+ prevExports ,
610+ nextExports ,
611+ ) {
597612 const ignoredExports = window . __getReactRefreshIgnoredExports ?. ( { id } ) ?? [ ]
598- if ( predicateOnExport ( ignoredExports , prevExports , ( key ) => key in nextExports ) !== true ) {
613+ if (
614+ predicateOnExport (
615+ ignoredExports ,
616+ prevExports ,
617+ ( key ) => key in nextExports ,
618+ ) !== true
619+ ) {
599620 return 'Could not Fast Refresh (export removed)'
600621 }
601- if ( predicateOnExport ( ignoredExports , nextExports , ( key ) => key in prevExports ) !== true ) {
622+ if (
623+ predicateOnExport (
624+ ignoredExports ,
625+ nextExports ,
626+ ( key ) => key in prevExports ,
627+ ) !== true
628+ ) {
602629 return 'Could not Fast Refresh (new export)'
603630 }
604631
0 commit comments