embedded-react 0.21.0 → 0.22.0

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.
Files changed (99) hide show
  1. package/README.md +2 -2
  2. package/aot/compile.mjs +1 -1
  3. package/aot/compiler/alerts.mjs +604 -0
  4. package/aot/compiler/check.mjs +1 -1
  5. package/aot/compiler/collect.mjs +1 -1
  6. package/aot/compiler/elements/button.mjs +3 -3
  7. package/aot/compiler/elements/image-background.mjs +1 -1
  8. package/aot/compiler/elements/props.mjs +10 -6
  9. package/aot/compiler/elements/section-list.mjs +1 -1
  10. package/aot/compiler/expressions.mjs +29 -2
  11. package/aot/compiler/handlers.mjs +73 -16
  12. package/aot/compiler/keyboard-dismiss.mjs +99 -0
  13. package/aot/compiler/keyboard.mjs +1 -1
  14. package/aot/compiler/lower.mjs +12 -0
  15. package/aot/compiler/nodes.mjs +17 -9
  16. package/aot/compiler/out.mjs +4 -0
  17. package/aot/compiler/package/codegen.mjs +36 -2
  18. package/aot/compiler/package/format.mjs +5 -3
  19. package/aot/compiler/package/lower.mjs +53 -19
  20. package/aot/compiler/scroll-to.mjs +112 -0
  21. package/aot/compiler/style-text.mjs +2 -2
  22. package/aot/compiler/svg.mjs +6 -3
  23. package/aot/compiler/updaters.mjs +1 -0
  24. package/aot/style-map.mjs +44 -1
  25. package/assets/bake-font.mjs +187 -244
  26. package/assets/bake-image.mjs +47 -71
  27. package/assets/bake-svg.mjs +465 -533
  28. package/assets/build-builtin-font.mjs +14 -27
  29. package/assets/emit-c.mjs +124 -204
  30. package/assets/emit-container.mjs +129 -197
  31. package/assets/emit-pack.mjs +92 -136
  32. package/assets/font-config.mjs +19 -27
  33. package/assets/font-sizes.mjs +432 -507
  34. package/assets/glyph-coverage.mjs +170 -214
  35. package/assets/index.mjs +52 -97
  36. package/assets/rasterize.mjs +173 -194
  37. package/assets/svg-loader.mjs +42 -48
  38. package/build.mjs +84 -101
  39. package/cli.mjs +482 -621
  40. package/compile-bin.mjs +24 -36
  41. package/flash.mjs +297 -401
  42. package/hotreload/dev-device.mjs +229 -270
  43. package/hotreload/pack-app.mjs +118 -159
  44. package/hotreload/pack-split.mjs +144 -200
  45. package/hotreload/package-transfer.mjs +128 -131
  46. package/hotreload/protocol.mjs +118 -118
  47. package/hotreload/uploader.mjs +132 -159
  48. package/hotreload/watch-tree.mjs +56 -65
  49. package/pack-container.mjs +93 -123
  50. package/package.json +19 -16
  51. package/persist-transform.mjs +89 -105
  52. package/qjsc-wasm.mjs +47 -72
  53. package/sim/embedded-react.wasm +0 -0
  54. package/sim/index.html +1 -1
  55. package/sim-server.mjs +260 -354
  56. package/src/embedded-react/Alert.mjs +112 -0
  57. package/src/embedded-react/Animated.mjs +412 -0
  58. package/src/embedded-react/{AppRegistry.js → AppRegistry.mjs} +26 -25
  59. package/src/embedded-react/{Button.js → Button.mjs} +29 -53
  60. package/src/embedded-react/{Dimensions.js → Dimensions.mjs} +12 -17
  61. package/src/embedded-react/Easing.mjs +34 -0
  62. package/src/embedded-react/{FlatList.js → FlatList.mjs} +25 -42
  63. package/src/embedded-react/{ImageBackground.js → ImageBackground.mjs} +11 -22
  64. package/src/embedded-react/Keyboard.mjs +82 -0
  65. package/src/embedded-react/{LayoutAnimation.js → LayoutAnimation.mjs} +17 -28
  66. package/src/embedded-react/PanResponder.mjs +256 -0
  67. package/src/embedded-react/{Platform.js → Platform.mjs} +8 -9
  68. package/src/embedded-react/{Pressable.js → Pressable.mjs} +12 -25
  69. package/src/embedded-react/SectionList.mjs +103 -0
  70. package/src/embedded-react/{StyleSheet.js → StyleSheet.mjs} +16 -20
  71. package/src/embedded-react/{TouchableOpacity.js → TouchableOpacity.mjs} +47 -83
  72. package/src/embedded-react/background-image.mjs +321 -0
  73. package/src/embedded-react/{components.js → components.mjs} +1 -3
  74. package/src/embedded-react/{imperative.js → imperative.mjs} +27 -38
  75. package/src/embedded-react/index.d.ts +155 -2
  76. package/src/embedded-react/index.js +26 -19
  77. package/src/embedded-react/layout-anim-config.mjs +85 -0
  78. package/src/embedded-react/{list-child.js → list-child.mjs} +11 -20
  79. package/src/embedded-react/{named-colors.js → named-colors.mjs} +2 -6
  80. package/src/embedded-react/nativeModule.mjs +371 -0
  81. package/src/embedded-react/split-style.mjs +57 -0
  82. package/src/embedded-react/svg-ops.mjs +1075 -0
  83. package/src/embedded-react/{useHostValue.js → useHostValue.mjs} +2 -4
  84. package/src/embedded-react/{usePersistentState.js → usePersistentState.mjs} +34 -38
  85. package/src/embedded-react/{warn-props.js → warn-props.mjs} +32 -39
  86. package/src/host-config.mjs +512 -0
  87. package/src/{native-ui.js → native-ui.mjs} +1 -8
  88. package/src/props.mjs +341 -0
  89. package/src/{renderer.js → renderer.mjs} +30 -44
  90. package/src/embedded-react/Animated.js +0 -440
  91. package/src/embedded-react/Easing.js +0 -39
  92. package/src/embedded-react/PanResponder.js +0 -330
  93. package/src/embedded-react/SectionList.js +0 -146
  94. package/src/embedded-react/layout-anim-config.js +0 -101
  95. package/src/embedded-react/nativeModule.js +0 -462
  96. package/src/embedded-react/split-style.js +0 -58
  97. package/src/embedded-react/svg-ops.js +0 -1295
  98. package/src/host-config.js +0 -548
  99. package/src/props.js +0 -306
package/src/props.mjs ADDED
@@ -0,0 +1,341 @@
1
+ /*
2
+ * Copyright 2026 Cory Lamming
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ // Pure prop-marshalling helpers. No engine / NativeUI dependency, so these are unit-testable in
17
+ // plain Node (see src/__tests__/props.unit.test.ts). The host config wires them to NativeUI.
18
+ import { parseBackgroundImage } from './embedded-react/background-image.mjs';
19
+ // Top-level props NativeUI understands directly (not part of `style`). Everything else style-ish is
20
+ // expected inside props.style. Event handlers (on*) are routed separately via setEvent.
21
+ export const PASSTHROUGH = [
22
+ 'delayLongPress',
23
+ 'numberOfLines',
24
+ 'ellipsizeMode',
25
+ 'value',
26
+ 'placeholder',
27
+ 'placeholderTextColor',
28
+ 'editable',
29
+ 'secureTextEntry',
30
+ 'animating',
31
+ 'visible',
32
+ 'backdropColor', // <Modal>'s scrim, as React Native takes it (the style key works too)
33
+ 'resizeMode',
34
+ 'tintColor',
35
+ 'imageName',
36
+ // Switch colours.
37
+ 'trackColor',
38
+ 'thumbColor',
39
+ // <Dial> (the native arc widget, ER_NODE_ARC).
40
+ 'min',
41
+ 'max',
42
+ 'startAngle',
43
+ 'sweepAngle',
44
+ 'step',
45
+ 'gapAngle',
46
+ 'thickness',
47
+ 'bandThickness',
48
+ 'knobSize',
49
+ 'knobBorderWidth',
50
+ 'indicatorColor',
51
+ 'bandColor',
52
+ 'knobColor',
53
+ 'knobBorderColor',
54
+ 'segments',
55
+ 'cap',
56
+ 'knob',
57
+ 'knobImage',
58
+ 'adjustable',
59
+ 'range',
60
+ 'valueStart',
61
+ 'minSpan',
62
+ 'indicatorGradient',
63
+ ];
64
+ /**
65
+ * Flattens RN-style `style` (object or nested array) into the `output` object.
66
+ */
67
+ export function flattenStyle(style, output) {
68
+ if (!style)
69
+ return;
70
+ if (Array.isArray(style)) {
71
+ for (const entry of style)
72
+ flattenStyle(entry, output);
73
+ }
74
+ else {
75
+ Object.assign(output, style);
76
+ }
77
+ }
78
+ /** Flattens a style (object/array) into a fresh plain object. */
79
+ export function flattenStyleObj(style) {
80
+ const flattened = {};
81
+ flattenStyle(style, flattened);
82
+ return flattened;
83
+ }
84
+ // Style fields the engine honors per inline text span (everything else inherits from the node).
85
+ const SPAN_STYLE_KEYS = [
86
+ 'color',
87
+ 'fontSize',
88
+ 'fontWeight',
89
+ 'fontStyle',
90
+ 'textDecorationLine',
91
+ 'letterSpacing',
92
+ ];
93
+ /**
94
+ * True when a <Text>'s children can be flattened inline — i.e. every leaf is a string/number or a
95
+ * nested <Text> element. A non-Text element (View, a component) makes it false, so the reconciler
96
+ * falls back to mounting children as separate instances.
97
+ */
98
+ export function isTextContent(children) {
99
+ if (children == null || children === false || children === true)
100
+ return true;
101
+ if (typeof children === 'string' || typeof children === 'number')
102
+ return true;
103
+ if (Array.isArray(children))
104
+ return children.every(isTextContent);
105
+ // A React element: only nested <Text> participates in inline flattening (type is the 'Text' tag).
106
+ if (children && children.props !== undefined)
107
+ return children.type === 'Text';
108
+ return false;
109
+ }
110
+ /**
111
+ * Walks a <Text>'s children into an ordered list of { text, style } segments. Primitive siblings
112
+ * share the parent's (base) style object by reference; a nested <Text> with its own style produces
113
+ * a new merged style object. Adjacent segments with the same style reference are coalesced — so
114
+ * plain interpolation like `Hi {name}` collapses to a single segment (no spans needed).
115
+ */
116
+ export function flattenTextChildren(children, baseStyle) {
117
+ const segments = [];
118
+ const push = (text, style) => {
119
+ if (text === '')
120
+ return;
121
+ const last = segments[segments.length - 1];
122
+ if (last && last.style === style)
123
+ last.text += text;
124
+ else
125
+ segments.push({ text, style });
126
+ };
127
+ const walk = (node, style) => {
128
+ if (node == null || node === false || node === true)
129
+ return;
130
+ if (typeof node === 'string' || typeof node === 'number') {
131
+ push(String(node), style);
132
+ return;
133
+ }
134
+ if (Array.isArray(node)) {
135
+ for (const child of node)
136
+ walk(child, style);
137
+ return;
138
+ }
139
+ if (node && node.props !== undefined) {
140
+ // Nested <Text>: merge its style over the inherited one (new object only when it has style,
141
+ // so an unstyled nested <Text> keeps the same reference and still coalesces with siblings).
142
+ const merged = node.props.style
143
+ ? Object.assign({}, style, flattenStyleObj(node.props.style))
144
+ : style;
145
+ walk(node.props.children, merged);
146
+ }
147
+ };
148
+ walk(children, baseStyle);
149
+ return segments;
150
+ }
151
+ /**
152
+ * Builds the inline-span array for a <Text> (for NativeUI.setTextSpans). Returns [] when the content
153
+ * is uniformly the base style (plain text — no spans needed); otherwise one span per styled segment,
154
+ * each carrying only the span-relevant style keys (the engine inherits the rest from the node).
155
+ */
156
+ export function buildTextSpans(props, flatStyle) {
157
+ if (!isTextContent(props.children))
158
+ return [];
159
+ const baseStyle = flatStyle || flattenStyleObj(props.style);
160
+ const segments = flattenTextChildren(props.children, baseStyle);
161
+ if (!segments.some(segment => segment.style !== baseStyle))
162
+ return [];
163
+ return segments.map(segment => {
164
+ const span = { text: segment.text };
165
+ for (const key of SPAN_STYLE_KEYS) {
166
+ if (segment.style && segment.style[key] !== undefined)
167
+ span[key] = segment.style[key];
168
+ }
169
+ return span;
170
+ });
171
+ }
172
+ /**
173
+ * Builds the flat prop bag NativeUI.setProps expects: resolved style + passthrough props + text.
174
+ */
175
+ /**
176
+ * Resolves an <Image source> to the engine asset name (the string registered via er_image_load and
177
+ * stored on the node as imageName). Accepts a bare name string — which is also what the bundler's
178
+ * image plugin turns `import logo from './logo.png'` into (the file's basename) — or an RN-style
179
+ * { uri } object. Returns null for anything unresolvable (e.g., a numeric require() id).
180
+ */
181
+ export function resolveImageSource(source) {
182
+ if (typeof source === 'string')
183
+ return source;
184
+ if (source && typeof source === 'object' && typeof source.uri === 'string')
185
+ return source.uri;
186
+ return null;
187
+ }
188
+ // Gradient strings already read, and the problems already warned about.
189
+ const backgroundImages = new Map();
190
+ const BACKGROUND_IMAGES_MAX = 32;
191
+ const backgroundProblems = new Set();
192
+ /**
193
+ * Reads a `backgroundImage` style into the gradient the bridge takes, or undefined (with one warning) for a
194
+ * value the engine does not draw.
195
+ */
196
+ export function resolveBackgroundImage(value) {
197
+ const cached = typeof value === 'string' ? backgroundImages.get(value) : null;
198
+ if (cached)
199
+ return cached;
200
+ const { gradient, problem } = parseBackgroundImage(value);
201
+ if (problem) {
202
+ if (!backgroundProblems.has(problem)) {
203
+ backgroundProblems.add(problem);
204
+ console.warn(`embedded-react: backgroundImage: ${problem}`);
205
+ }
206
+ return undefined;
207
+ }
208
+ if (typeof value === 'string') {
209
+ if (backgroundImages.size >= BACKGROUND_IMAGES_MAX)
210
+ backgroundImages.clear();
211
+ backgroundImages.set(value, gradient);
212
+ }
213
+ return gradient;
214
+ }
215
+ export function buildProps(type, props, flatStyle) {
216
+ const flat = flatStyle ? { ...flatStyle } : {};
217
+ if (!flatStyle)
218
+ flattenStyle(props.style, flat);
219
+ // A <Dial> keeps the engine's gradient fields for its indicatorGradient.
220
+ if (flat.backgroundImage != null) {
221
+ flat.backgroundImage =
222
+ type === 'Dial'
223
+ ? undefined
224
+ : resolveBackgroundImage(flat.backgroundImage);
225
+ }
226
+ for (const key of PASSTHROUGH) {
227
+ if (props[key] !== undefined)
228
+ flat[key] = props[key];
229
+ }
230
+ // <Svg> takes width/height as DIRECT props (the react-native-svg convention) — the engine sizes the
231
+ // vector node from them. Fold them into the resolved style (an explicit style width/height still wins)
232
+ // so Flow A matches the Flow B AOT, which reads svg.props.width/height directly (aot/compiler/svg.mts emitSvgBox).
233
+ if (type === 'Svg') {
234
+ if (flat.width === undefined && props.width !== undefined)
235
+ flat.width = props.width;
236
+ if (flat.height === undefined && props.height !== undefined)
237
+ flat.height = props.height;
238
+ }
239
+ // <Image source={...}> resolves to the engine asset name unless imageName was set explicitly.
240
+ if (flat.imageName === undefined && props.source != null) {
241
+ const name = resolveImageSource(props.source);
242
+ if (name != null)
243
+ flat.imageName = name;
244
+ }
245
+ // <Dial knobImage={require(...)}> takes an asset source like <Image source>; a plain string is an
246
+ // asset name already.
247
+ if (type === 'Dial' &&
248
+ props.knobImage != null &&
249
+ typeof props.knobImage !== 'string') {
250
+ const name = resolveImageSource(props.knobImage);
251
+ flat.knobImage = name != null ? name : undefined;
252
+ }
253
+ // `visible` is the Modal's own show/hide prop (it maps to ERProps.modal_visible). On every other
254
+ // component it used to be silently inert; it now means the same thing as `display`, so a subtree can
255
+ // be pruned from layout, raster and hit-testing without unmounting it. An explicit style `display`
256
+ // wins, so the two spellings can't disagree.
257
+ if (type !== 'Modal' && flat.visible !== undefined) {
258
+ if (flat.display === undefined)
259
+ flat.display = flat.visible ? 'flex' : 'none';
260
+ delete flat.visible;
261
+ }
262
+ // <Text> content: flatten string/number/nested-<Text> children into the node's full-text string.
263
+ // The engine renders this when no spans are set; with spans (buildTextSpans) it carries the same
264
+ // text for the plain-text fallback. Non-flattenable children fall back to mounted child instances.
265
+ if (type === 'Text' && isTextContent(props.children)) {
266
+ const baseStyle = flatStyle || flattenStyleObj(props.style);
267
+ flat.text = flattenTextChildren(props.children, baseStyle)
268
+ .map(segment => segment.text)
269
+ .join('');
270
+ }
271
+ return flat;
272
+ }
273
+ // Bail-out depth for deepEqualProps. Real host props are shallow (style ≈ 2 levels, a nested-<Text>
274
+ // span or <Svg> shape tree ≈ 3 levels per element); anything deeper is pathological and bails to
275
+ // "changed", whose worst case is a redundant re-apply — exactly the pre-diff behavior.
276
+ const DEEP_EQUAL_MAX_DEPTH = 24;
277
+ /**
278
+ * Deep value equality for host-prop diffing (the reconciler's prepareUpdate). Re-renders recreate
279
+ * prop objects every time, so identity alone can't tell "nothing changed" — this compares by value:
280
+ * primitives via Object.is, arrays elementwise, React elements by type and props (keys don't affect a
281
+ * flattened <Text>/<Svg> subtree's output), and plain objects key-by-key. Class instances (e.g.,
282
+ * Animated.Value) compare by IDENTITY only: a fresh instance must read as changed, so it gets bound
283
+ * to the node, while the same instance is already bound and can be skipped.
284
+ */
285
+ export function deepEqualProps(left, right, depth = 0) {
286
+ if (Object.is(left, right))
287
+ return true;
288
+ if (depth >= DEEP_EQUAL_MAX_DEPTH)
289
+ return false;
290
+ if (typeof left !== 'object' ||
291
+ typeof right !== 'object' ||
292
+ left === null ||
293
+ right === null)
294
+ return false;
295
+ if (Array.isArray(left) || Array.isArray(right)) {
296
+ if (!Array.isArray(left) ||
297
+ !Array.isArray(right) ||
298
+ left.length !== right.length)
299
+ return false;
300
+ for (let index = 0; index < left.length; index++) {
301
+ if (!deepEqualProps(left[index], right[index], depth + 1))
302
+ return false;
303
+ }
304
+ return true;
305
+ }
306
+ // React elements: equal when they render the same host output — same type, same props.
307
+ if (left.$$typeof !== right.$$typeof)
308
+ return false;
309
+ if (left.$$typeof !== undefined) {
310
+ return (left.type === right.type &&
311
+ deepEqualProps(left.props, right.props, depth + 1));
312
+ }
313
+ // Plain objects only; class instances fall through to "changed" (identity already ruled equal out).
314
+ const leftPrototype = Object.getPrototypeOf(left);
315
+ const rightPrototype = Object.getPrototypeOf(right);
316
+ if ((leftPrototype !== null && leftPrototype !== Object.prototype) ||
317
+ (rightPrototype !== null && rightPrototype !== Object.prototype))
318
+ return false;
319
+ const leftKeys = Object.keys(left);
320
+ const rightKeys = Object.keys(right);
321
+ if (leftKeys.length !== rightKeys.length)
322
+ return false;
323
+ for (const key of leftKeys) {
324
+ if (!Object.prototype.hasOwnProperty.call(right, key))
325
+ return false;
326
+ if (!deepEqualProps(left[key], right[key], depth + 1))
327
+ return false;
328
+ }
329
+ return true;
330
+ }
331
+ /**
332
+ * True for an `onXxx` prop whose value is a function (an event handler to route via setEvent).
333
+ */
334
+ export function isEventProp(key, value) {
335
+ return (key.length > 2 &&
336
+ key[0] === 'o' &&
337
+ key[1] === 'n' &&
338
+ key[2] >= 'A' &&
339
+ key[2] <= 'Z' &&
340
+ typeof value === 'function');
341
+ }
@@ -13,20 +13,16 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
-
17
16
  // Public renderer API: createRoot(...).render(<App/>).
18
17
  //
19
18
  // The container is a real engine View node set as the scene root; React children mount into it.
20
19
  // We use LegacyRoot (synchronous) mode so the initial render flushes without depending on the
21
20
  // async scheduler/timers — the host's frame loop then paints whatever the tree became.
22
21
  import Reconciler from 'react-reconciler';
23
- import {hostConfig} from './host-config.js';
24
- import {NativeUI} from './native-ui.js';
25
-
22
+ import { hostConfig } from './host-config.mjs';
23
+ import { NativeUI } from './native-ui.mjs';
26
24
  const reconciler = Reconciler(hostConfig);
27
-
28
25
  const LegacyRoot = 0;
29
-
30
26
  // Host-initiated updates — a native event, a timer, a promise continuation — are outside any React
31
27
  // batch, so in LegacyRoot mode each setState renders and commits on its own: three animations
32
28
  // ticking on the same frame cost three renders and three engine commits to paint one frame. The
@@ -38,54 +34,44 @@ const LegacyRoot = 0;
38
34
  // boundary is only visible from here — React flushes when it decides to, not reliably at the batch
39
35
  // call the C side can see — so marking it in C measured the call overhead and left reconcile at ~0.
40
36
  // The instrumented wrapper is chosen ONCE, here, so an ordinary build runs the plain one.
41
- NativeUI.setBatcher?.(
42
- NativeUI.perfRenderBegin
37
+ NativeUI.setBatcher?.(NativeUI.perfRenderBegin
43
38
  ? (callback, firstArgument, secondArgument) => {
44
39
  NativeUI.perfRenderBegin();
45
40
  try {
46
- return reconciler.batchedUpdates(() => {
47
- NativeUI.perfCallbackBegin();
48
- try {
49
- return callback(firstArgument, secondArgument);
50
- } finally {
51
- NativeUI.perfCallbackEnd();
52
- }
53
- });
54
- } finally {
55
- NativeUI.perfRenderEnd();
41
+ return reconciler.batchedUpdates(() => {
42
+ NativeUI.perfCallbackBegin();
43
+ try {
44
+ return callback(firstArgument, secondArgument);
45
+ }
46
+ finally {
47
+ NativeUI.perfCallbackEnd();
48
+ }
49
+ });
56
50
  }
57
- }
58
- : (callback, firstArgument, secondArgument) =>
59
- reconciler.batchedUpdates(() =>
60
- callback(firstArgument, secondArgument),
61
- ),
62
- );
63
-
51
+ finally {
52
+ NativeUI.perfRenderEnd();
53
+ }
54
+ }
55
+ : (callback, firstArgument, secondArgument) => reconciler.batchedUpdates(() => callback(firstArgument, secondArgument)));
64
56
  /**
65
57
  * Creates a root bound to a screen-sized container node.
66
58
  *
67
- * @param {object} containerProps Props for the container View (e.g. width/height/backgroundColor).
68
- * @returns {{ render: (element: any) => void }}
59
+ * `containerProps` are the container View's props (e.g. width/height/backgroundColor).
69
60
  */
70
61
  export function createRoot(containerProps) {
71
- const container = NativeUI.createNode('View');
72
- NativeUI.setProps(container, containerProps || {});
73
- NativeUI.setRoot(container);
74
-
75
- const fiberRoot = reconciler.createContainer(
76
- container, // containerInfo — our root node handle
77
- LegacyRoot,
78
- null, // hydration callbacks
62
+ const container = NativeUI.createNode('View');
63
+ NativeUI.setProps(container, containerProps || {});
64
+ NativeUI.setRoot(container);
65
+ const fiberRoot = reconciler.createContainer(container, // containerInfo — our root node handle
66
+ LegacyRoot, null, // hydration callbacks
79
67
  false, // isStrictMode
80
68
  null, // concurrentUpdatesByDefaultOverride
81
69
  '', // identifierPrefix
82
- error => console.error('react recoverable error:', error),
83
- null, // transitionCallbacks
84
- );
85
-
86
- return {
87
- render(element) {
88
- reconciler.updateContainer(element, fiberRoot, null, null);
89
- },
90
- };
70
+ // identifierPrefix
71
+ error => console.error('react recoverable error:', error), null);
72
+ return {
73
+ render(element) {
74
+ reconciler.updateContainer(element, fiberRoot, null, null);
75
+ },
76
+ };
91
77
  }