Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

§Functions

useCallback

Returns a memoized version of the callback that only changes if one of the inputs has changed (using ===).

useContext

Returns the current context value, as given by the nearest context provider for the given context. When the provider updates, this Hook will trigger a rerender with the latest context value.

useDebugValue

Customize the displayed value in the devtools panel.

useEffect

Accepts a function that contains imperative, possibly effectful code. The effects run after browser paint, without blocking it.

useErrorBoundary
useId
useImperativeHandle
useLayoutEffect

Accepts a function that contains imperative, possibly effectful code. Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside useLayoutEffect will be flushed synchronously, after all DOM mutations but before the browser has a chance to paint. Prefer the standard useEffect hook when possible to avoid blocking visual updates.

useMemo

Pass a factory function and an array of inputs. useMemo will only recompute the memoized value when one of the inputs has changed. This optimization helps to avoid expensive calculations on every render. If no array is provided, a new value will be computed whenever a new function instance is passed as the first argument.

useReducer

An alternative to useState.

useRef

useRef returns a mutable ref object whose .current property is initialized to the passed argument (initialValue). The returned object will persist for the full lifetime of the component.

useState

Returns a stateful value, and a function to update it.

§Type Aliases

Dispatch
Reducer
StateUpdater