Loading
Use the loading action set to indicate to users that a page is loading or an upload is processing.
You can use the features action in the following ways:
Plain JavaScript
Anchor link to section titled "Plain JavaScript"Example code
Anchor link to section titled "Example code"Import the createApp
function from @shopify/app-bridge
and the Loading
from @shopify/app-bridge/actions
. Then use the createApp
function to create an app.
Start loading
Anchor link to section titled "Start loading"Dispatch the START
loading action when loading new pages or starting asynchronous requests if there will be a noticeable delay in loading the content.
Stop loading
Anchor link to section titled "Stop loading"After the loading action is complete, dispatch the STOP
loading action.
Subscribe to actions
Anchor link to section titled "Subscribe to actions"You can subscribe to actions from the loading action set.
Subscribe to all actions
Anchor link to section titled "Subscribe to all actions"You can subscribe to all loading actions, regardless of which action sets trigger the actions:
The App Bridge React library provides a Loading
component to indicate to users that a page is loading or an upload is processing.
Render the Loading
component if there will be a noticeable delay in loading the content.
Example code
Anchor link to section titled "Example code"Import the Loading
component from @shopify/app-bridge-react
.