Skip to content

Commit

Permalink
WIP(ui-source-code-editor): webpack trick
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Feb 20, 2024
1 parent 1633c60 commit 5692394
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ export default function customSearch(searchConfig: SearchConfig | undefined) {
const dom = document.createElement('div')
dom.style.padding = '8px'
if (!React.version.startsWith('16.')) {
const path = 'react-dom/client'
import(path)
// https://stackoverflow.com/a/67141850
const REQUIRE_TERMINATOR = ''
import(`react-dom/client${REQUIRE_TERMINATOR}`)
.then((r) => {
const root = r.createRoot(dom)
root.render(
Expand Down

0 comments on commit 5692394

Please sign in to comment.