Skip to content

Commit

Permalink
Fix shadow dom example
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 4, 2025
1 parent 3a321d4 commit 2f6010f
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-nocheck
import { useEffect, useRef, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'

import createCache from '@emotion/cache'
import { CacheProvider } from '@emotion/react'
Expand Down Expand Up @@ -90,14 +89,16 @@ const ShadowComponent = () => {
}, [])
return (
<div ref={node}>
{rootNode &&
createPortal(
<CacheProvider value={cacheNode}>
<JBrowseLinearGenomeView viewState={config} />
<div ref={nodeForPin} />
</CacheProvider>,
rootNode,
)}
{rootNode && config
? createPortal(
// @ts-expect-error
<CacheProvider value={cacheNode}>
<JBrowseLinearGenomeView viewState={config} />
<div ref={nodeForPin} />
</CacheProvider>,
rootNode,
)
: null}
</div>
)
}
Expand All @@ -112,6 +113,7 @@ export const ShadowDOMOneLinearGenomeView = () => {
}
return (
<div>
{/* @ts-expect-error */}
<jbrowse-linear-view />
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/examples/ShadowDOMOneLinearGenomeView.tsx">
Source code
Expand Down

0 comments on commit 2f6010f

Please sign in to comment.