You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: cli/JSXV4.md
+16-6
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,26 @@ To build an entire project in V4 mode, including all its dependencies, use the n
18
18
### Dependency-level config
19
19
20
20
Dependencies inherit the `jsx` configuration of the root project. So if the root project uses V4 then the dependencies are built using V4, and the same for V3.
21
-
To build certain dependencies in V3 compatibility mode, whatever the version used in the root project, use `"v3-dependencies"` as in the example:
21
+
To build certain dependencies in V3 compatibility mode, whatever the version used in the root project, use `"v3-dependencies"`: the listed dependencies will be built in V3 mode, and in addition `-open ReatcV3` is added to the compiler options.
22
+
23
+
For example, suppose a V3 project uses rescript-react 0.11, which requires compatibility mode if compiled with V3, and that 2 dependencies `"rescript-react-native", "rescript-react-navigation"` only build with compatibility mode. Then the setting will be:
In V3 compatibility mode, the listed dependencies are built in V3 mode, and in addition `-open ReatcV3` is added to the compiler options, so that the `ReactV3` compatibility module in rescript-react is used.
33
+
Another example is a V4 project that also uses `"rescript-react-native", "rescript-react-navigation"`. Then the setting will be:
V4 introduces support to control the definition of the `props` type by passing as argument to `@react.component` the body of the type definition of `props`. The main application is sharing a single type definition across several components. Here are a few examples:
380
390
381
-
382
391
```rescript
383
392
type sharedprops<'x, 'y> = {x: 'x, y: 'y, z:string}
384
393
@@ -400,6 +409,7 @@ module C3 = {
400
409
```
401
410
402
411
The generated code (some details removed) looks like this:
0 commit comments