Liking cljdoc? Tell your friends :D

hx.hooks


<-callbackcljsdeprecated

source

<-contextcljsdeprecated

Just react/useContext

Just react/useContext
sourceraw docstring

<-debug-valuecljsdeprecated

Just react/useDebugValue

Just react/useDebugValue
sourceraw docstring

<-derefcljsdeprecated

(<-deref a)

Takes an atom. Returns the currently derefed value of the atom, and re-renders the component on change.

Takes an atom. Returns the currently derefed value of the atom, and re-renders
the component on change.
sourceraw docstring

<-effectcljsdeprecated

source

<-imperative-handlecljsdeprecated

source

<-layout-effectcljsdeprecated

source

<-memocljsdeprecated

Just react/useMemo

Just react/useMemo
sourceraw docstring

<-reducercljsdeprecated

Just react/useReducer.

Just react/useReducer.
sourceraw docstring

<-refcljsdeprecated

source

<-statecljsdeprecated

source

<-valuecljsdeprecated

source

useCallbackcljs

(useCallback f)
(useCallback f deps)

Just react/useCallback

Just react/useCallback
sourceraw docstring

useContextcljs

Just react/useContext

Just react/useContext
sourceraw docstring

useDebugValuecljs

Just react/useDebugValue

Just react/useDebugValue
sourceraw docstring

useEffectcljs

(useEffect f)
(useEffect f deps)

Just react/useEffect

Just react/useEffect
sourceraw docstring

useImperativeHandlecljs

(useImperativeHandle ref create-handle)
(useImperativeHandle ref create-handle deps)

Just react/useImperativeHandle

Just react/useImperativeHandle
sourceraw docstring

useIRefcljs

(useIRef initial)

Takes an initial value. Returns an atom that will NOT re-render component on change.

Takes an initial value. Returns an atom that will _NOT_ re-render component
on change.
sourceraw docstring

useLayoutEffectcljs

(useLayoutEffect f)
(useLayoutEffect f deps)

Just react/useLayoutEffect

Just react/useLayoutEffect
sourceraw docstring

useMemocljs

Just react/useMemo

Just react/useMemo
sourceraw docstring

useReducercljs

(useReducer reducer init-state)
(useReducer reducer init-state init)

Just react/useReducer.

Just react/useReducer.
sourceraw docstring

useStatecljs

(useState initial)
(useState initial eq?)

Like React.useState, but the update function returned can be used similar to swap!.

Example:

(let [[state set-state] (useState {:count 0})]
 ;; ...
 (set-state update :count inc))

If eq? is passed in, will use that function to determine whether to update the React state. If it returns true, it will keep the old state, false it will render with new state.

Like `React.useState`, but the update function returned can be used similar
to `swap!`.

Example:
```
(let [[state set-state] (useState {:count 0})]
 ;; ...
 (set-state update :count inc))
```

If `eq?` is passed in, will use that function to determine whether to update
the React state. If it returns `true`, it will keep the old state, `false` it
will render with new state.
sourceraw docstring

useValuecljs

(useValue x)

Caches x. When a new x is passed in, returns new x only if it is not structurally equal to the previous x.

Useful for optimizing <-effect et. al. when you have two values that might be structurally equal by referentially different.

Caches `x`. When a new `x` is passed in, returns new `x` only if it is
not structurally equal to the previous `x`.

Useful for optimizing `<-effect` et. al. when you have two values that might
be structurally equal by referentially different.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close