Skip to content

Commit c5467c9

Browse files
committed
Add a comment on the arbitrary timeout
1 parent 73e8836 commit c5467c9

File tree

1 file changed

+9
-0
lines changed
  • packages/edit-site/src/components/editor

1 file changed

+9
-0
lines changed

packages/edit-site/src/components/editor/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ export default function Editor() {
164164
useEffect( () => {
165165
if ( ! hasResolvingSelectors && ! loaded ) {
166166
clearTimeout( timeoutRef.current );
167+
168+
/*
169+
* We're using an arbitrary 1s timeout here to catch brief moments
170+
* without any resolving selectors that would result in displaying
171+
* brief flickers of loading state and loaded state.
172+
*
173+
* It's worth experimenting with different values, since this also
174+
* adds 1s of artificial delay after loading has finished.
175+
*/
167176
timeoutRef.current = setTimeout( () => {
168177
setLoaded( true );
169178
}, 1000 );

0 commit comments

Comments
 (0)