Skip to content

hooks/state

Here are all state hooks.

Use @zl-asica/react or @zl-asica/react/hooks for all hooks.

Example

tsx
import { useToggle } from '@zl-asica/react/hooks'

const App = () => {
  const { value, toggle } = useToggle(false)

  return (
    <button onClick={toggle}>{value ? 'On' : 'Off'}</button>
  )
}

Functions

Released under the MIT License.