简体   繁体   中英

Embed GitHub Gist using Remix

Is it possible to embed a Gist in Remix? I'm trying to embed the following gist in Remix using:

<script src='https://gist.github.com/AnthonyLzq/7d1cfeda389b7f5f38b62bd2640a32ba.js'></script>

But it is not displaying anything.

The problem is that React is trying to hydrate the <script> element. Since you don't want React to process this, you need to treat it as raw HTML.

<div
  dangerouslySetInnerHTML={{
    __html: `<script src="https://gist.github.com/AnthonyLzq/7d1cfeda389b7f5f38b62bd2640a32ba.js"></script>`,
  }}
/>

嵌入式要点

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM