rescript-react icon indicating copy to clipboard operation
rescript-react copied to clipboard

`onReset` is not allowed on form properties

Open gaeulbyul opened this issue 3 years ago • 0 comments

rescript-react doesn't allow onReset prop on <form> element. (I think it should allow?)

Example:

let onSubmit = event => {
  Js.log("submitted")
}

let onReset = event => {
  Js.log("resetted")
}

@react.component
let make = () => {
  <form onSubmit onReset>
    <input type_="submit" value="Submit" />
    <input type_="reset" value="Reset" />
  </form>
}

Error:

[E] Line 11, column 17:
The function applied to this argument has type
    (
  ~?key: string,
  ~?ref: ReactDOM.domRef,
  /* skip */
) => ReactDOM.Props.domProps
This argument cannot be applied with label ~onReset

gaeulbyul avatar Jan 09 '22 11:01 gaeulbyul