Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

Commit 2a8744c

Browse files
authored
Update README.md
1 parent 75c508b commit 2a8744c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ In case of mixed named and unnamed arguments, consecutive named arguments form s
123123
### components
124124
ReasonReact components with props of Reason types `t1`, `t2`, `t3` are mapped to reactjs components with props of the JS types corresponding to `t1`, `t2`, `t3`.
125125

126+
### imported types
127+
It's possible to import an existing TS/Flow type as an opaque type in Reason. For example,
128+
```reason
129+
[@genType.import "./SomeFlowTypes"] type anInterestingFlowType;
130+
```
131+
defines a type which maps to `anInterestingFlowType` in `SomeFlowTypes.js`.
132+
126133
### polymorphic types
127134
If a Reason type contains a type variable, the corresponding value is not converted. In other words, the conversion is the identity function. For example, a Reason function of type `{payload: 'a} => 'a` must treat the value of the payload as a black box, as a consequence of parametric polymorphism. If a typed back-end is used, the reason type is mapped to the corresponding generic type.
128135

0 commit comments

Comments
 (0)