0.0.1-alpha.4 • Published 2 years ago

@coloration/use-react v0.0.1-alpha.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@coloration/use-react

One extension library of basic hooks

Startup

$ npm install @coloration/use-react -S
import { useClassName } from '@coloration/use-react'

export type HTMLElementProps<T> = DetailedHTMLProps<HTMLAttributes<T>, T>
export interface ButtonProps extends HTMLElementProps<HTMLButtonElement> {}

export function Button ({ className, ...restProps }: ButtonProps) {
  const [newClassName] = useClassName('my-button', className)

  return <button className={newClassName} {...restProps} />
}

All Hooks