@kaliber/build 0.0.143 → 0.0.145
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/build.js +1 -1
- package/lib/universalComponents.js +7 -1
- package/package.json +1 -1
package/lib/build.js
CHANGED
@@ -69,7 +69,7 @@ const babelLoader = {
|
|
69
69
|
cacheDirectory: './.babelcache/',
|
70
70
|
cacheCompression: false,
|
71
71
|
babelrc: false, // this needs to be false, any other value will cause .babelrc to interfere with these settings
|
72
|
-
presets: [
|
72
|
+
presets: ['@babel/preset-react'],
|
73
73
|
plugins: [
|
74
74
|
['@babel/plugin-proposal-decorators', { legacy: true }],
|
75
75
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
@@ -45,7 +45,13 @@ export function hydrate(component, { nodes: initialNodes, startNode, endNode })
|
|
45
45
|
const container = createVirtualReactContainer({ initialNodes, startNode, endNode })
|
46
46
|
const root = hydrateRoot(container, component)
|
47
47
|
|
48
|
-
return {
|
48
|
+
return {
|
49
|
+
update(newComponent) {
|
50
|
+
root.unmount()
|
51
|
+
root = createRoot(container)
|
52
|
+
root.render(newComponent)
|
53
|
+
}
|
54
|
+
}
|
49
55
|
}
|
50
56
|
|
51
57
|
function createVirtualReactContainer({ initialNodes, startNode, endNode }) {
|
package/package.json
CHANGED