Skip to content

Commit e6fbd54

Browse files
committed
prettier
1 parent 8f6fff7 commit e6fbd54

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,20 +627,21 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
627627
return <Text text={JSON.stringify(text)} />;
628628
}
629629

630-
spyOnDev(console, 'error')
630+
spyOnDev(console, 'error');
631631

632632
expect(() => {
633633
act(() => {
634634
createRoot(<App />);
635-
})
636-
})
637-
.toThrow(
635+
});
636+
}).toThrow(
638637
'Maximum update depth exceeded. This can happen when a component repeatedly ' +
639-
'calls setState inside componentWillUpdate or componentDidUpdate. React limits ' +
640-
'the number of nested updates to prevent infinite loops.'
641-
)
638+
'calls setState inside componentWillUpdate or componentDidUpdate. React limits ' +
639+
'the number of nested updates to prevent infinite loops.',
640+
);
642641
if (__DEV__) {
643-
expect(console.error.calls.argsFor(0)[0]).toMatch('The result of getSnapshot should be cached to avoid an infinite loop')
642+
expect(console.error.calls.argsFor(0)[0]).toMatch(
643+
'The result of getSnapshot should be cached to avoid an infinite loop',
644+
);
644645
}
645646
});
646647
});

packages/use-sync-external-store/src/useSyncExternalStore.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const useSyncExternalStore =
2929
builtInAPI !== undefined ? builtInAPI : useSyncExternalStore_shim;
3030

3131
let didWarnOld18Alpha = false;
32-
let didWarnUncachedGetSnapshot = false
32+
let didWarnUncachedGetSnapshot = false;
3333

3434
// Disclaimer: This shim breaks many of the rules of React, and only works
3535
// because of a very particular set of implementation details and assumptions
@@ -67,8 +67,10 @@ function useSyncExternalStore_shim<T>(
6767
if (__DEV__) {
6868
if (!didWarnUncachedGetSnapshot) {
6969
if (value !== getSnapshot()) {
70-
console.error('The result of getSnapshot should be cached to avoid an infinite loop')
71-
didWarnUncachedGetSnapshot = true
70+
console.error(
71+
'The result of getSnapshot should be cached to avoid an infinite loop',
72+
);
73+
didWarnUncachedGetSnapshot = true;
7274
}
7375
}
7476
}

0 commit comments

Comments
 (0)