xote 4.15.2 → 4.15.3
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/package.json +1 -1
- package/src/Xote__JSX.res +6 -2
- package/src/Xote__JSX.res.mjs +8 -2
package/package.json
CHANGED
package/src/Xote__JSX.res
CHANGED
|
@@ -9,8 +9,12 @@ type component<'props> = 'props => element
|
|
|
9
9
|
|
|
10
10
|
type componentLike<'props, 'return> = 'props => 'return
|
|
11
11
|
|
|
12
|
-
/* JSX functions for component creation -
|
|
13
|
-
|
|
12
|
+
/* JSX functions for component creation - wrap in LazyComponent to defer evaluation.
|
|
13
|
+
* This ensures component functions (which may create effects/computeds) are not
|
|
14
|
+
* evaluated during a Computed context, which would incorrectly track their
|
|
15
|
+
* dependencies as belonging to the outer computed. */
|
|
16
|
+
let jsx = (component: component<'props>, props: 'props): element =>
|
|
17
|
+
Component.LazyComponent(() => component(props))
|
|
14
18
|
|
|
15
19
|
let jsxs = jsx
|
|
16
20
|
|
package/src/Xote__JSX.res.mjs
CHANGED
|
@@ -5,11 +5,17 @@ import * as Xote__Component from "./Xote__Component.res.mjs";
|
|
|
5
5
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
6
6
|
|
|
7
7
|
function jsx(component, props) {
|
|
8
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
TAG: "LazyComponent",
|
|
10
|
+
_0: () => component(props)
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
function jsxKeyed(component, props, key, param) {
|
|
12
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
TAG: "LazyComponent",
|
|
17
|
+
_0: () => component(props)
|
|
18
|
+
};
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
function jsxFragment(props) {
|