File tree 2 files changed +18
-5
lines changed
packages/gatsby/cache-dir 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import DevLoader from "./dev-loader"
12
12
import syncRequires from "$virtual/sync-requires"
13
13
// Generated during bootstrap
14
14
import matchPaths from "$virtual/match-paths.json"
15
+ import { LoadingIndicatorEventHandler } from "./loading-indicator"
15
16
16
17
if ( process . env . GATSBY_HOT_LOADER === `fast-refresh` && module . hot ) {
17
18
module . hot . accept ( `$virtual/sync-requires` , ( ) => {
@@ -164,6 +165,23 @@ apiRunnerAsync(`onClientEntry`).then(() => {
164
165
165
166
renderer ( < Root /> , rootElement , ( ) => {
166
167
apiRunner ( `onInitialClientRender` )
168
+
169
+ // Render query on demand overlay
170
+ if (
171
+ process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR &&
172
+ process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`
173
+ ) {
174
+ const indicatorMountElement = document . createElement ( `div` )
175
+ indicatorMountElement . setAttribute (
176
+ `id` ,
177
+ `query-on-demand-indicator-element`
178
+ )
179
+ document . body . append ( indicatorMountElement )
180
+ ReactDOM . render (
181
+ < LoadingIndicatorEventHandler /> ,
182
+ indicatorMountElement
183
+ )
184
+ }
167
185
} )
168
186
} )
169
187
} )
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import loader from "./loader"
12
12
import { PageQueryStore , StaticQueryStore } from "./query-result-store"
13
13
import EnsureResources from "./ensure-resources"
14
14
import FastRefreshOverlay from "./fast-refresh-overlay"
15
-
16
15
import { reportError , clearError } from "./error-overlay-handler"
17
16
import { LoadingIndicatorEventHandler } from "./loading-indicator"
18
17
@@ -148,9 +147,5 @@ const ConditionalFastRefreshOverlay = ({ children }) => {
148
147
export default ( ) => (
149
148
< ConditionalFastRefreshOverlay >
150
149
< StaticQueryStore > { WrappedRoot } </ StaticQueryStore >
151
- { process . env . GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&
152
- process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true` && (
153
- < LoadingIndicatorEventHandler />
154
- ) }
155
150
</ ConditionalFastRefreshOverlay >
156
151
)
You can’t perform that action at this time.
0 commit comments