Skip to content

Commit

Permalink
update root component to only load App when plugin div is present
Browse files Browse the repository at this point in the history
this prevents the plugin from doing any background loading whilst SG maintenance mode is active
  • Loading branch information
louise-davies authored Oct 13, 2023
1 parent 92ac903 commit 057609d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function domElementGetter(): HTMLElement {
const reactLifecycles = singleSpaReact({
React,
ReactDOMClient,
rootComponent: App,
rootComponent: () => document.getElementById(pluginName) ? <App /> : null,
domElementGetter,
errorBoundary: (error) => {
log.error(`${pluginName} failed with error: ${error}`);
Expand Down

0 comments on commit 057609d

Please sign in to comment.