@react-three/fiber 8.0.0-beta-02 → 8.0.0-beta-03
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/CHANGELOG.md +36 -0
- package/dist/declarations/src/core/events.d.ts +4 -4
- package/dist/declarations/src/core/renderer.d.ts +5 -5
- package/dist/declarations/src/core/store.d.ts +11 -5
- package/dist/declarations/src/core/utils.d.ts +8 -1
- package/dist/declarations/src/index.d.ts +2 -1
- package/dist/declarations/src/native/index.d.ts +3 -4
- package/dist/declarations/src/native.d.ts +2 -1
- package/dist/declarations/src/three-types.d.ts +5 -16
- package/dist/declarations/src/web/Canvas.d.ts +1 -1
- package/dist/declarations/src/web/index.d.ts +3 -4
- package/dist/{hooks-c89a6f88.esm.js → hooks-15c12e3e.esm.js} +218 -134
- package/dist/{hooks-dd693347.cjs.dev.js → hooks-6526f63c.cjs.dev.js} +225 -137
- package/dist/{hooks-e01f12ec.cjs.prod.js → hooks-7b7e01e6.cjs.prod.js} +225 -137
- package/dist/react-three-fiber.cjs.dev.js +188 -184
- package/dist/react-three-fiber.cjs.prod.js +188 -184
- package/dist/react-three-fiber.esm.js +184 -180
- package/native/dist/react-three-fiber-native.cjs.dev.js +208 -209
- package/native/dist/react-three-fiber-native.cjs.prod.js +208 -209
- package/native/dist/react-three-fiber-native.esm.js +206 -207
- package/package.json +7 -8
- package/readme.md +10 -10
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var hooks = require('../../dist/hooks-
|
|
6
|
-
var
|
|
5
|
+
var hooks = require('../../dist/hooks-7b7e01e6.cjs.prod.js');
|
|
6
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var THREE = require('three');
|
|
9
|
+
var reactNative = require('react-native');
|
|
10
|
+
var expoGl = require('expo-gl');
|
|
8
11
|
var constants = require('react-reconciler/constants');
|
|
9
12
|
var Pressability = require('react-native/Libraries/Pressability/Pressability');
|
|
10
|
-
var reactNative = require('react-native');
|
|
11
13
|
var expoAsset = require('expo-asset');
|
|
12
14
|
var expoFileSystem = require('expo-file-system');
|
|
13
15
|
var base64Arraybuffer = require('base64-arraybuffer');
|
|
14
16
|
var suspendReact = require('suspend-react');
|
|
15
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
16
|
-
var expoGl = require('expo-gl');
|
|
17
|
-
var pick = require('lodash-es/pick');
|
|
18
|
-
var omit = require('lodash-es/omit');
|
|
19
17
|
require('react-reconciler');
|
|
18
|
+
require('scheduler');
|
|
20
19
|
require('zustand');
|
|
21
20
|
|
|
22
21
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -30,20 +29,20 @@ function _interopNamespace(e) {
|
|
|
30
29
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
31
30
|
Object.defineProperty(n, k, d.get ? d : {
|
|
32
31
|
enumerable: true,
|
|
33
|
-
get: function () {
|
|
32
|
+
get: function () {
|
|
33
|
+
return e[k];
|
|
34
|
+
}
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
n[
|
|
39
|
+
n['default'] = e;
|
|
39
40
|
return Object.freeze(n);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
43
43
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
44
|
+
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
44
45
|
var Pressability__default = /*#__PURE__*/_interopDefault(Pressability);
|
|
45
|
-
var pick__default = /*#__PURE__*/_interopDefault(pick);
|
|
46
|
-
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
47
46
|
|
|
48
47
|
// @ts-ignore
|
|
49
48
|
const EVENTS = {
|
|
@@ -113,7 +112,7 @@ function createTouchEvents(store) {
|
|
|
113
112
|
events
|
|
114
113
|
} = store.getState();
|
|
115
114
|
events.disconnect == null ? void 0 : events.disconnect();
|
|
116
|
-
const manager = new Pressability__default[
|
|
115
|
+
const manager = new Pressability__default['default'](events == null ? void 0 : events.handlers);
|
|
117
116
|
set(state => ({
|
|
118
117
|
events: { ...state.events,
|
|
119
118
|
connected: manager
|
|
@@ -138,127 +137,6 @@ function createTouchEvents(store) {
|
|
|
138
137
|
};
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
const CANVAS_PROPS = ['gl', 'events', 'size', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', // 'dpr',
|
|
142
|
-
'performance', 'clock', 'raycaster', 'camera', 'onPointerMissed', 'onCreated']; // React currently throws a warning when using useLayoutEffect on the server.
|
|
143
|
-
// To get around it, we can conditionally useEffect on the server (no-op) and
|
|
144
|
-
// useLayoutEffect in the browser.
|
|
145
|
-
|
|
146
|
-
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
147
|
-
|
|
148
|
-
function Block({
|
|
149
|
-
set
|
|
150
|
-
}) {
|
|
151
|
-
useIsomorphicLayoutEffect(() => {
|
|
152
|
-
set(new Promise(() => null));
|
|
153
|
-
return () => set(false);
|
|
154
|
-
}, []);
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
class ErrorBoundary extends React__namespace.Component {
|
|
159
|
-
constructor(...args) {
|
|
160
|
-
super(...args);
|
|
161
|
-
this.state = {
|
|
162
|
-
error: false
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
componentDidCatch(error) {
|
|
167
|
-
this.props.set(error);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
render() {
|
|
171
|
-
return this.state.error ? null : this.props.children;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
ErrorBoundary.getDerivedStateFromError = () => ({
|
|
177
|
-
error: true
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
const Canvas = /*#__PURE__*/React__namespace.forwardRef(({
|
|
181
|
-
children,
|
|
182
|
-
fallback,
|
|
183
|
-
style,
|
|
184
|
-
events,
|
|
185
|
-
nativeRef_EXPERIMENTAL,
|
|
186
|
-
onContextCreate,
|
|
187
|
-
...props
|
|
188
|
-
}, forwardedRef) => {
|
|
189
|
-
const canvasProps = pick__default["default"](props, CANVAS_PROPS);
|
|
190
|
-
const viewProps = omit__default["default"](props, CANVAS_PROPS);
|
|
191
|
-
const [context, setContext] = React__namespace.useState(null);
|
|
192
|
-
const [{
|
|
193
|
-
width,
|
|
194
|
-
height
|
|
195
|
-
}, setSize] = React__namespace.useState({
|
|
196
|
-
width: 0,
|
|
197
|
-
height: 0
|
|
198
|
-
});
|
|
199
|
-
const [bind, setBind] = React__namespace.useState();
|
|
200
|
-
const [block, setBlock] = React__namespace.useState(false);
|
|
201
|
-
const [error, setError] = React__namespace.useState(false); // Suspend this component if block is a promise (2nd run)
|
|
202
|
-
|
|
203
|
-
if (block) throw block; // Throw exception outwards if anything within canvas throws
|
|
204
|
-
|
|
205
|
-
if (error) throw error;
|
|
206
|
-
const onLayout = React__namespace.useCallback(e => {
|
|
207
|
-
const {
|
|
208
|
-
width,
|
|
209
|
-
height
|
|
210
|
-
} = e.nativeEvent.layout;
|
|
211
|
-
setSize({
|
|
212
|
-
width,
|
|
213
|
-
height
|
|
214
|
-
});
|
|
215
|
-
}, []); // Execute JSX in the reconciler as a layout-effect
|
|
216
|
-
|
|
217
|
-
useIsomorphicLayoutEffect(() => {
|
|
218
|
-
if (width > 0 && height > 0 && context) {
|
|
219
|
-
const store = render( /*#__PURE__*/React__namespace.createElement(ErrorBoundary, {
|
|
220
|
-
set: setError
|
|
221
|
-
}, /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
|
|
222
|
-
fallback: /*#__PURE__*/React__namespace.createElement(Block, {
|
|
223
|
-
set: setBlock
|
|
224
|
-
})
|
|
225
|
-
}, children)), context, { ...canvasProps,
|
|
226
|
-
size: {
|
|
227
|
-
width,
|
|
228
|
-
height
|
|
229
|
-
},
|
|
230
|
-
events: events || createTouchEvents
|
|
231
|
-
});
|
|
232
|
-
const state = store.getState();
|
|
233
|
-
setBind(state.events.connected.getEventHandlers());
|
|
234
|
-
}
|
|
235
|
-
}, [width, height, children, context, canvasProps]);
|
|
236
|
-
useIsomorphicLayoutEffect(() => {
|
|
237
|
-
return () => {
|
|
238
|
-
if (context) unmountComponentAtNode(context);
|
|
239
|
-
};
|
|
240
|
-
}, []);
|
|
241
|
-
return /*#__PURE__*/React__namespace.createElement(reactNative.View, _extends({}, viewProps, {
|
|
242
|
-
ref: forwardedRef,
|
|
243
|
-
onLayout: onLayout,
|
|
244
|
-
style: {
|
|
245
|
-
flex: 1,
|
|
246
|
-
...style
|
|
247
|
-
}
|
|
248
|
-
}, bind), width > 0 && /*#__PURE__*/React__namespace.createElement(expoGl.GLView, {
|
|
249
|
-
nativeRef_EXPERIMENTAL: ref => {
|
|
250
|
-
if (nativeRef_EXPERIMENTAL && !nativeRef_EXPERIMENTAL.current) {
|
|
251
|
-
nativeRef_EXPERIMENTAL.current = ref;
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
onContextCreate: async gl => {
|
|
255
|
-
await (onContextCreate == null ? void 0 : onContextCreate(gl));
|
|
256
|
-
setContext(gl);
|
|
257
|
-
},
|
|
258
|
-
style: reactNative.StyleSheet.absoluteFill
|
|
259
|
-
}));
|
|
260
|
-
});
|
|
261
|
-
|
|
262
140
|
/**
|
|
263
141
|
* Generates an asset based on input type.
|
|
264
142
|
*/
|
|
@@ -293,8 +171,6 @@ function loadingFn(extensions, onProgress) {
|
|
|
293
171
|
if (extensions) extensions(loader); // Go through the urls and load them
|
|
294
172
|
|
|
295
173
|
return Promise.all(input.map(entry => new Promise(async (res, reject) => {
|
|
296
|
-
var _parse, _ref;
|
|
297
|
-
|
|
298
174
|
// Construct URL
|
|
299
175
|
const url = typeof entry === 'string' ? loader.path + entry : entry; // There's no Image in native, so we create & pass a data texture instead
|
|
300
176
|
|
|
@@ -341,7 +217,7 @@ function loadingFn(extensions, onProgress) {
|
|
|
341
217
|
} = await getAsset(url).downloadAsync();
|
|
342
218
|
const arrayBuffer = await toBuffer(localUri); // Parse it
|
|
343
219
|
|
|
344
|
-
const parsed =
|
|
220
|
+
const parsed = loader.parse == null ? void 0 : loader.parse(arrayBuffer, undefined, data => {
|
|
345
221
|
if (data.scene) Object.assign(data, hooks.buildGraph(data.scene));
|
|
346
222
|
res(data);
|
|
347
223
|
}, error => reject(`Could not load ${url}: ${error.message}`)); // Respect synchronous parsers which don't have callbacks
|
|
@@ -423,84 +299,90 @@ const createRendererInstance = (gl, context) => {
|
|
|
423
299
|
|
|
424
300
|
function createRoot(context, config) {
|
|
425
301
|
return {
|
|
426
|
-
render: element =>
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
302
|
+
render: element => {
|
|
303
|
+
var _store;
|
|
304
|
+
|
|
305
|
+
let {
|
|
306
|
+
gl,
|
|
307
|
+
size = {
|
|
308
|
+
width: 0,
|
|
309
|
+
height: 0
|
|
310
|
+
},
|
|
311
|
+
events,
|
|
312
|
+
onCreated,
|
|
313
|
+
...props
|
|
314
|
+
} = config || {};
|
|
315
|
+
let root = roots.get(context);
|
|
316
|
+
let fiber = root == null ? void 0 : root.fiber;
|
|
317
|
+
let store = root == null ? void 0 : root.store;
|
|
318
|
+
let state = (_store = store) == null ? void 0 : _store.getState();
|
|
319
|
+
|
|
320
|
+
if (fiber && state) {
|
|
321
|
+
// When a root was found, see if any fundamental props must be changed or exchanged
|
|
322
|
+
// Check size
|
|
323
|
+
if (state.size.width !== size.width || state.size.height !== size.height) state.setSize(size.width, size.height); // Check frameloop
|
|
324
|
+
|
|
325
|
+
if (state.frameloop !== props.frameloop) state.setFrameloop(props.frameloop); // For some props we want to reset the entire root
|
|
326
|
+
// Changes to the color-space
|
|
327
|
+
|
|
328
|
+
const linearChanged = props.linear !== state.internal.lastProps.linear;
|
|
329
|
+
|
|
330
|
+
if (linearChanged) {
|
|
331
|
+
unmountComponentAtNode(context);
|
|
332
|
+
fiber = undefined;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
455
335
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
336
|
+
if (!fiber) {
|
|
337
|
+
// If no root has been found, make one
|
|
338
|
+
// Create gl
|
|
339
|
+
const glRenderer = createRendererInstance(gl, context); // Create store
|
|
340
|
+
|
|
341
|
+
store = hooks.createStore(applyProps, invalidate, advance, {
|
|
342
|
+
gl: glRenderer,
|
|
343
|
+
size,
|
|
344
|
+
...props,
|
|
345
|
+
// expo-gl can only render at native dpr/resolution
|
|
346
|
+
// https://github.com/expo/expo-three/issues/39
|
|
347
|
+
dpr: reactNative.PixelRatio.get()
|
|
348
|
+
});
|
|
349
|
+
const state = store.getState(); // Create renderer
|
|
461
350
|
|
|
462
|
-
|
|
463
|
-
// If no root has been found, make one
|
|
464
|
-
// Create gl
|
|
465
|
-
const glRenderer = createRendererInstance(gl, context); // Create store
|
|
466
|
-
|
|
467
|
-
store = hooks.createStore(applyProps, invalidate, advance, {
|
|
468
|
-
gl: glRenderer,
|
|
469
|
-
size,
|
|
470
|
-
...props,
|
|
471
|
-
// expo-gl can only render at native dpr/resolution
|
|
472
|
-
// https://github.com/expo/expo-three/issues/39
|
|
473
|
-
dpr: reactNative.PixelRatio.get()
|
|
474
|
-
});
|
|
475
|
-
const state = store.getState(); // Create renderer
|
|
351
|
+
fiber = reconciler.createContainer(store, constants.ConcurrentRoot, false, null); // Map it
|
|
476
352
|
|
|
477
|
-
|
|
353
|
+
roots.set(context, {
|
|
354
|
+
fiber,
|
|
355
|
+
store
|
|
356
|
+
}); // Store event manager internally and connect it
|
|
478
357
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
store
|
|
482
|
-
}); // Store event manager internally and connect it
|
|
358
|
+
if (events) {
|
|
359
|
+
var _state$get$events$con, _state$get$events;
|
|
483
360
|
|
|
484
|
-
|
|
485
|
-
|
|
361
|
+
state.set({
|
|
362
|
+
events: events(store)
|
|
363
|
+
});
|
|
364
|
+
(_state$get$events$con = (_state$get$events = state.get().events).connect) == null ? void 0 : _state$get$events$con.call(_state$get$events, context);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
486
367
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
368
|
+
if (store && fiber) {
|
|
369
|
+
reconciler.updateContainer( /*#__PURE__*/React__namespace.createElement(Provider, {
|
|
370
|
+
store: store,
|
|
371
|
+
element: element,
|
|
372
|
+
onCreated: onCreated
|
|
373
|
+
}), fiber, null, () => undefined);
|
|
374
|
+
return store;
|
|
375
|
+
} else {
|
|
376
|
+
throw 'Error creating root!';
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
unmount: () => unmountComponentAtNode(context)
|
|
380
|
+
};
|
|
381
|
+
}
|
|
493
382
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
element: element,
|
|
498
|
-
onCreated: onCreated
|
|
499
|
-
}), fiber, null, () => undefined);
|
|
500
|
-
return store;
|
|
501
|
-
} else {
|
|
502
|
-
throw 'Error creating root!';
|
|
503
|
-
}
|
|
383
|
+
function render(element, context, config = {}) {
|
|
384
|
+
console.warn('R3F.render is no longer supported in React 18. Use createRoot instead!');
|
|
385
|
+
return createRoot(context, config).render(element);
|
|
504
386
|
}
|
|
505
387
|
|
|
506
388
|
function Provider({
|
|
@@ -552,7 +434,7 @@ function unmountComponentAtNode(context, callback) {
|
|
|
552
434
|
}
|
|
553
435
|
}
|
|
554
436
|
|
|
555
|
-
const act =
|
|
437
|
+
const act = React__namespace.unstable_act;
|
|
556
438
|
|
|
557
439
|
function createPortal(children, container) {
|
|
558
440
|
return reconciler.createPortal(children, container, null, null);
|
|
@@ -564,6 +446,123 @@ reconciler.injectIntoDevTools({
|
|
|
564
446
|
version: '18.0.0'
|
|
565
447
|
});
|
|
566
448
|
|
|
449
|
+
const CANVAS_PROPS = ['gl', 'events', 'shadows', 'linear', 'flat', 'orthographic', 'frameloop', 'performance', 'clock', 'raycaster', 'camera', 'onPointerMissed', 'onCreated'];
|
|
450
|
+
|
|
451
|
+
function Block({
|
|
452
|
+
set
|
|
453
|
+
}) {
|
|
454
|
+
React__namespace.useLayoutEffect(() => {
|
|
455
|
+
set(new Promise(() => null));
|
|
456
|
+
return () => set(false);
|
|
457
|
+
}, [set]);
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
class ErrorBoundary extends React__namespace.Component {
|
|
462
|
+
constructor(...args) {
|
|
463
|
+
super(...args);
|
|
464
|
+
this.state = {
|
|
465
|
+
error: false
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
componentDidCatch(error) {
|
|
470
|
+
this.props.set(error);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
render() {
|
|
474
|
+
return this.state.error ? null : this.props.children;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
ErrorBoundary.getDerivedStateFromError = () => ({
|
|
480
|
+
error: true
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
const Canvas = /*#__PURE__*/React__namespace.forwardRef(({
|
|
484
|
+
children,
|
|
485
|
+
fallback,
|
|
486
|
+
style,
|
|
487
|
+
events,
|
|
488
|
+
nativeRef_EXPERIMENTAL,
|
|
489
|
+
onContextCreate,
|
|
490
|
+
...props
|
|
491
|
+
}, forwardedRef) => {
|
|
492
|
+
// Create a known catalogue of Threejs-native elements
|
|
493
|
+
// This will include the entire THREE namespace by default, users can extend
|
|
494
|
+
// their own elements by using the createRoot API instead
|
|
495
|
+
React__namespace.useMemo(() => hooks.extend(THREE__namespace), []);
|
|
496
|
+
const [{
|
|
497
|
+
width,
|
|
498
|
+
height
|
|
499
|
+
}, setSize] = React__namespace.useState({
|
|
500
|
+
width: 0,
|
|
501
|
+
height: 0
|
|
502
|
+
});
|
|
503
|
+
const [context, setContext] = React__namespace.useState(null);
|
|
504
|
+
const [bind, setBind] = React__namespace.useState();
|
|
505
|
+
const canvasProps = hooks.pick(props, CANVAS_PROPS);
|
|
506
|
+
const viewProps = hooks.omit(props, CANVAS_PROPS);
|
|
507
|
+
const [block, setBlock] = React__namespace.useState(false);
|
|
508
|
+
const [error, setError] = React__namespace.useState(false); // Suspend this component if block is a promise (2nd run)
|
|
509
|
+
|
|
510
|
+
if (block) throw block; // Throw exception outwards if anything within canvas throws
|
|
511
|
+
|
|
512
|
+
if (error) throw error;
|
|
513
|
+
const onLayout = React__namespace.useCallback(e => {
|
|
514
|
+
const {
|
|
515
|
+
width,
|
|
516
|
+
height
|
|
517
|
+
} = e.nativeEvent.layout;
|
|
518
|
+
setSize({
|
|
519
|
+
width,
|
|
520
|
+
height
|
|
521
|
+
});
|
|
522
|
+
}, []);
|
|
523
|
+
|
|
524
|
+
if (width > 0 && height > 0 && context) {
|
|
525
|
+
const store = createRoot(context, { ...canvasProps,
|
|
526
|
+
size: {
|
|
527
|
+
width,
|
|
528
|
+
height
|
|
529
|
+
},
|
|
530
|
+
events: events || createTouchEvents
|
|
531
|
+
}).render( /*#__PURE__*/React__namespace.createElement(ErrorBoundary, {
|
|
532
|
+
set: setError
|
|
533
|
+
}, /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
|
|
534
|
+
fallback: /*#__PURE__*/React__namespace.createElement(Block, {
|
|
535
|
+
set: setBlock
|
|
536
|
+
})
|
|
537
|
+
}, children)));
|
|
538
|
+
const state = store.getState();
|
|
539
|
+
setBind(state.events.connected.getEventHandlers());
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
React__namespace.useEffect(() => {
|
|
543
|
+
return () => unmountComponentAtNode(context);
|
|
544
|
+
}, [context]);
|
|
545
|
+
return /*#__PURE__*/React__namespace.createElement(reactNative.View, _extends({}, viewProps, {
|
|
546
|
+
ref: forwardedRef,
|
|
547
|
+
onLayout: onLayout,
|
|
548
|
+
style: {
|
|
549
|
+
flex: 1,
|
|
550
|
+
...style
|
|
551
|
+
}
|
|
552
|
+
}, bind), width > 0 && /*#__PURE__*/React__namespace.createElement(expoGl.GLView, {
|
|
553
|
+
nativeRef_EXPERIMENTAL: ref => {
|
|
554
|
+
if (nativeRef_EXPERIMENTAL && !nativeRef_EXPERIMENTAL.current) {
|
|
555
|
+
nativeRef_EXPERIMENTAL.current = ref;
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
onContextCreate: async gl => {
|
|
559
|
+
await (onContextCreate == null ? void 0 : onContextCreate(gl));
|
|
560
|
+
setContext(gl);
|
|
561
|
+
},
|
|
562
|
+
style: reactNative.StyleSheet.absoluteFill
|
|
563
|
+
}));
|
|
564
|
+
});
|
|
565
|
+
|
|
567
566
|
exports.ReactThreeFiber = hooks.threeTypes;
|
|
568
567
|
exports.addAfterEffect = hooks.addAfterEffect;
|
|
569
568
|
exports.addEffect = hooks.addEffect;
|