New bucklescript syntax

This commit is contained in:
Anthony Cicchetti 2020-07-15 22:21:49 -04:00
parent 8e335314c4
commit 0b3642e08d

View file

@ -1,6 +1,6 @@
type formattedString = string; type formattedString = string;
[@react.component] @react.component
let make = () => { let make = () => {
let (date: MomentRe.Moment.t, updateDate) = let (date: MomentRe.Moment.t, updateDate) =
React.useState(MomentRe.momentNow); React.useState(MomentRe.momentNow);
@ -11,7 +11,7 @@ let make = () => {
}; };
let handleChange = (event: ReactEvent.Form.t) => { let handleChange = (event: ReactEvent.Form.t) => {
let value: formattedString = ReactEvent.Form.target(event)##value; let value: formattedString = ReactEvent.Form.target(event)["value"];
updateDate(_ => {value->MomentRe.momentWithFormat("YYYY-MM-DD")}); updateDate(_ => {value->MomentRe.momentWithFormat("YYYY-MM-DD")});
}; };