Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/gatsby-plugin-gatsby-cloud/src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ const ShadowPortal = ({ children, identifier }) => {
)
}

export const wrapRootElement = ({ element }) => {
if (process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true`) {
export const wrapRootElement = ({ element }, pluginOptions) => {
if (
process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true` &&
!pluginOptions.disablePreviewUI
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!pluginOptions.disablePreviewUI
!pluginOptions?.disablePreviewUI

I can't remember if they have no options pluginOptions will be undefined or it will be an empty object. So let's just guard against it in case it is undefined

) {
return (
<>
{element}
Expand Down