16 lines
392 B
JavaScript
16 lines
392 B
JavaScript
import React from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import SearchBar from './Search/SearchBar'
|
|
|
|
function mount() {
|
|
const container = document.getElementById('topbar-search-root')
|
|
if (!container) return
|
|
createRoot(container).render(<SearchBar />)
|
|
}
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', mount)
|
|
} else {
|
|
mount()
|
|
}
|