Skip to content

Commit

Permalink
fix: remove [@mel.uncurry] from React.useCallback* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Sep 19, 2023
1 parent 66f89ba commit b8c0f2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
25 changes: 9 additions & 16 deletions src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -350,46 +350,39 @@ external useMemo7:
type callback('input, 'output) = 'input => 'output;

[@mel.module "react"]
external useCallback:
([@mel.uncurry] ('input => 'output)) => callback('input, 'output) =
external useCallback: ('input => 'output) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback0:
([@mel.uncurry] ('input => 'output), [@mel.as {json|[]|json}] _) =>
callback('input, 'output) =
('input => 'output, [@mel.as {json|[]|json}] _) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback1:
([@mel.uncurry] ('input => 'output), array('a)) =>
callback('input, 'output) =
('input => 'output, array('a)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback2:
([@mel.uncurry] ('input => 'output), ('a, 'b)) => callback('input, 'output) =
('input => 'output, ('a, 'b)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback3:
([@mel.uncurry] ('input => 'output), ('a, 'b, 'c)) =>
callback('input, 'output) =
('input => 'output, ('a, 'b, 'c)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback4:
([@mel.uncurry] ('input => 'output), ('a, 'b, 'c, 'd)) =>
callback('input, 'output) =
('input => 'output, ('a, 'b, 'c, 'd)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback5:
([@mel.uncurry] ('input => 'output), ('a, 'b, 'c, 'd, 'e)) =>
callback('input, 'output) =
('input => 'output, ('a, 'b, 'c, 'd, 'e)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback6:
([@mel.uncurry] ('input => 'output), ('a, 'b, 'c, 'd, 'e, 'f)) =>
callback('input, 'output) =
('input => 'output, ('a, 'b, 'c, 'd, 'e, 'f)) => callback('input, 'output) =
"useCallback";
[@mel.module "react"]
external useCallback7:
([@mel.uncurry] ('input => 'output), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) =>
('input => 'output, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) =>
callback('input, 'output) =
"useCallback";

Expand Down
6 changes: 2 additions & 4 deletions test/blackbox-tests/useCallback.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
var React = require("react");
var cb = React.useCallback((function (a) {
return function (b) {
return a + b | 0;
};
var cb = React.useCallback((function (a, b) {
return a + b | 0;
}), []);
exports.cb = cb;
Expand Down

0 comments on commit b8c0f2f

Please sign in to comment.