@kaliber/build 0.0.145 → 0.0.146
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
|
|
1
|
-
import { hydrateRoot } from 'react-dom/client'
|
1
|
+
import { hydrateRoot, createRoot } from 'react-dom/client'
|
2
2
|
import { safeJsonStringify } from '@kaliber/safe-json-stringify'
|
3
3
|
|
4
4
|
const containerMarker = 'data-kaliber-component-container'
|
@@ -43,13 +43,13 @@ export function findComponents({ componentName }) {
|
|
43
43
|
|
44
44
|
export function hydrate(component, { nodes: initialNodes, startNode, endNode }) {
|
45
45
|
const container = createVirtualReactContainer({ initialNodes, startNode, endNode })
|
46
|
-
|
46
|
+
let root = hydrateRoot(container, component)
|
47
47
|
|
48
|
-
return {
|
48
|
+
return {
|
49
49
|
update(newComponent) {
|
50
50
|
root.unmount()
|
51
51
|
root = createRoot(container)
|
52
|
-
root.render(newComponent)
|
52
|
+
root.render(newComponent)
|
53
53
|
}
|
54
54
|
}
|
55
55
|
}
|
package/package.json
CHANGED