Commit 78893fb
Update React_V3.ref to define record fields
With this change we can refer to `.current` field of the record by opening the module.
Previously the following code would fail to compile with " The record field React.current can't be found."
```
open ReactV3
@get external videoWidth: Dom.Element.t => float = "videoWidth"
@get external videoHeight: Dom.Element.t => float = "videoHeight"
let getVideoDimensions = videoRef =>
videoRef.React.current
->Js.Nullable.toOption
->Option.map(video => (video->videoWidth, video->videoHeight))
```1 parent 86b7f85 commit 78893fb
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments