chore: app group optimizations (#1027)
This commit is contained in:
10
app/assets/javascripts/Utils/PreactUtils.ts
Normal file
10
app/assets/javascripts/Utils/PreactUtils.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { render } from 'preact'
|
||||
|
||||
/**
|
||||
* Source: https://stackoverflow.com/questions/50946950/how-to-destroy-root-preact-node
|
||||
* For some reason importing `import { unmountComponentAtNode } from 'preact/compat'` inside of app/index.tsx
|
||||
* results in the app failing to compile.
|
||||
*/
|
||||
export function unmountComponentAtRoot(root: HTMLElement) {
|
||||
render(null, root)
|
||||
}
|
||||
Reference in New Issue
Block a user