Skip to content

at0g/hooks

Repository files navigation

hooks for react

npm (scoped with tag) npm bundle size npm License

dependencies dev dependencies Snyk Vulnerabilities for GitHub Repo

Maintainability Test Coverage code style: prettier

CircleCI

installation

npm

npm i -S @upr/hooks

browser

<script src="https://unpkg.com/@upr/hooks"></script>
<!-- access as window.uprHooks -->

usage

import React from 'react'
import { useOffline } from '@upr/hooks'

export default () => {
    const fallbackValue = false
    const offline = useOffline(fallbackValue)

    return <>{offline && 'Offline'}</>
}

Releases

No releases published

Packages

No packages published