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
3 changes: 0 additions & 3 deletions src/React.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions src/React.res
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ external useCallback7: ('callback, ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'callback =
@module("react")
external useContext: Context.t<'any> => 'any = "useContext"

@module("react")
external usePromise: promise<'a> => 'a = "use"

@module("react") external useRef: 'value => ref<'value> = "useRef"

@module("react")
Expand Down Expand Up @@ -433,17 +436,6 @@ external useActionState: (
external useOptimistic: ('state, ('state, 'action) => 'state) => ('state, 'action => unit) =
"useOptimistic"

module Usable = {
type t<'value>

external context: Context.t<'value> => t<'value> = "%identity"
external promise: promise<'value> => t<'value> = "%identity"
}

/** `use` is a React API that lets you read the value of a resource like a Promise or context. */
@module("react")
external use: Usable.t<'value> => 'value = "use"

/** `act` is a test helper to apply pending React updates before making assertions. */
@module("react")
external act: (unit => promise<unit>) => promise<unit> = "act"