@weaverse/react 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -3
- package/dist/index.mjs +10 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -142,9 +142,12 @@ function generateItemClassName(instance, stitchesInstance) {
|
|
|
142
142
|
|
|
143
143
|
// src/renderer.tsx
|
|
144
144
|
var WeaverseRoot = (0, import_react3.memo)(({ context }) => {
|
|
145
|
-
let data = (0, import_react3.useSyncExternalStore)(
|
|
145
|
+
let data = (0, import_react3.useSyncExternalStore)(
|
|
146
|
+
context.subscribe,
|
|
147
|
+
context.getSnapShot,
|
|
148
|
+
context.getSnapShot
|
|
149
|
+
);
|
|
146
150
|
let rootRef = (0, import_react3.useRef)();
|
|
147
|
-
console.log("data", data);
|
|
148
151
|
(0, import_react3.useEffect)(() => {
|
|
149
152
|
context.contentRootElement = rootRef?.current || null;
|
|
150
153
|
}, [context]);
|
|
@@ -175,7 +178,11 @@ var WeaverseRoot = (0, import_react3.memo)(({ context }) => {
|
|
|
175
178
|
var ItemComponent = (0, import_react3.memo)(({ instance }) => {
|
|
176
179
|
let context = useWeaverse();
|
|
177
180
|
let { stitchesInstance, elementRegistry, platformType } = context;
|
|
178
|
-
let data = (0, import_react3.useSyncExternalStore)(
|
|
181
|
+
let data = (0, import_react3.useSyncExternalStore)(
|
|
182
|
+
instance.subscribe,
|
|
183
|
+
instance.getSnapShot,
|
|
184
|
+
instance.getSnapShot
|
|
185
|
+
);
|
|
179
186
|
let {
|
|
180
187
|
id,
|
|
181
188
|
type,
|
package/dist/index.mjs
CHANGED
|
@@ -99,9 +99,12 @@ function generateItemClassName(instance, stitchesInstance) {
|
|
|
99
99
|
|
|
100
100
|
// src/renderer.tsx
|
|
101
101
|
var WeaverseRoot = memo(({ context }) => {
|
|
102
|
-
let data = useSyncExternalStore(
|
|
102
|
+
let data = useSyncExternalStore(
|
|
103
|
+
context.subscribe,
|
|
104
|
+
context.getSnapShot,
|
|
105
|
+
context.getSnapShot
|
|
106
|
+
);
|
|
103
107
|
let rootRef = useRef();
|
|
104
|
-
console.log("data", data);
|
|
105
108
|
useEffect2(() => {
|
|
106
109
|
context.contentRootElement = rootRef?.current || null;
|
|
107
110
|
}, [context]);
|
|
@@ -132,7 +135,11 @@ var WeaverseRoot = memo(({ context }) => {
|
|
|
132
135
|
var ItemComponent = memo(({ instance }) => {
|
|
133
136
|
let context = useWeaverse();
|
|
134
137
|
let { stitchesInstance, elementRegistry, platformType } = context;
|
|
135
|
-
let data = useSyncExternalStore(
|
|
138
|
+
let data = useSyncExternalStore(
|
|
139
|
+
instance.subscribe,
|
|
140
|
+
instance.getSnapShot,
|
|
141
|
+
instance.getSnapShot
|
|
142
|
+
);
|
|
136
143
|
let {
|
|
137
144
|
id,
|
|
138
145
|
type,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@weaverse/react",
|
|
3
3
|
"author": "Weaverse Team",
|
|
4
4
|
"description": "React bindings for Weaverse",
|
|
5
|
-
"version": "2.10.
|
|
5
|
+
"version": "2.10.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"typings": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"singleQuote": true
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@weaverse/core": "2.10.
|
|
34
|
+
"@weaverse/core": "2.10.2",
|
|
35
35
|
"clsx": "^2.1.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|