Skip to content

Using Shortcodes with React lazy #1492

Answered by ChristianMurphy
tnorlund asked this question in Q&A
Discussion options

You must be logged in to vote

The error you're getting is because you are passing a rendered element instead of a component.

const components = { 
  DocsGrid,
  CICD: () => (<>
    {
      typeof window ==! "undefined" && <React.Suspense 
        fallback={<div height={`200pt`}></div>}
      ><CICD /></React.Suspense>
    }
  </>)
}

should work.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@tnorlund
Comment options

@JounQin
Comment options

JounQin Mar 25, 2021
Collaborator

@tnorlund
Comment options

@tnorlund
Comment options

@tnorlund
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants