Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# v0.0.8 (unrelease)

- Add `useWatch` hook
- Updated Controller component type definition in react-hook-form: made name parameter required and rules parameter optional

# v0.0.7

Expand Down
4 changes: 2 additions & 2 deletions doc/transformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ module ControllerOfInputs = {

@module("react-hook-form") @react.component
external make: (
~name: variantOfInputs=?,
~name: variantOfInputs,
~control: controlOfInputs=?,
~rules: controllerRulesOfInputs,
~rules: controllerRulesOfInputs=?,
~render: controllerFieldsOfInputs => React.element=?,
) => React.element = "Controller"
}
Expand Down
10 changes: 5 additions & 5 deletions src/ppx/signature.ml
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ let map_type_decl
];
(* @module("react-hook-form") @react.component
external make: (
~name: variantOfInputs=?,
~name: variantOfInputs,
~control: controlOfInputs=?,
~rules: controllerRulesOfInputs,
~rules: controllerRulesOfInputs=?,
~render: controllerFieldsOfInputs => React.element=?,
) => React.element = "Controller" *)
Sig.value
Expand All @@ -564,17 +564,17 @@ let map_type_decl
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "variantOf" ^ capitalize record_name)
[])
(Typ.arrow (Labelled "control")
(Typ.arrow (Optional "control")
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "controlOf"
^ capitalize record_name)
[])
(Typ.arrow (Labelled "rules")
(Typ.arrow (Optional "rules")
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "controllerRulesOf"
^ capitalize record_name)
[])
(Typ.arrow (Labelled "render")
(Typ.arrow (Optional "render")
(uncurried_core_type_arrow
~attrs:[ attr_named_arg ] ~arity:1
[
Expand Down
10 changes: 5 additions & 5 deletions src/ppx/structure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ let map_type_decl
];
(* @module("react-hook-form") @react.component
external make: (
~name: variantOfInputs=?,
~name: variantOfInputs,
~control: controlOfInputs=?,
~rules: controllerRulesOfInputs,
~rules: controllerRulesOfInputs=?,
~render: controllerFieldsOfInputs => React.element=?,
) => React.element = "Controller" *)
Str.primitive
Expand All @@ -563,17 +563,17 @@ let map_type_decl
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "variantOf" ^ capitalize record_name)
[])
(Typ.arrow (Labelled "control")
(Typ.arrow (Optional "control")
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "controlOf"
^ capitalize record_name)
[])
(Typ.arrow (Labelled "rules")
(Typ.arrow (Optional "rules")
(Typ.constr ~attrs:[ attr_named_arg ]
(lid @@ "controllerRulesOf"
^ capitalize record_name)
[])
(Typ.arrow (Labelled "render")
(Typ.arrow (Optional "render")
(uncurried_core_type_arrow
~attrs:[ attr_named_arg ] ~arity:1
[
Expand Down