1.2.3 • Published 2 years ago

@marsidev/react-hooks v1.2.3

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

Introduction

This is a collection of common React Hooks that I use in my React projects.

Bootstraped with antfu/starter-ts.

Inspired by usehooks-ts, @restart/hooks, and @chakra-ui/hooks.

Installation

  • Using npm

    npm i @marsidev/react-hooks
  • Using pnpm

    pnpm add @marsidev/react-hooks
  • Using yarn

    yarn add @marsidev/react-hooks

Example

import { useScrollY } from '@marsidev/react-hooks'
import { Header, Footer, ScrollToTop } from '~/components'

export const Layout = ({ children }) => {
  const { offsetPassed } = useScrollY(400)

  return (
    <div>
      <Header />
      <main>{children}</main>
      <Footer />
      {offsetPassed && <ScrollToTop />}
    </div>
  )
}

Available Hooks

  • useCopyElementToClipboard
  • useCopyToClipboard
  • useInput
  • useRendered
  • useSafeLayoutEffect
  • useScrollY
  • useWindowSize
1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago