1.0.2 • Published 1 year ago

react-confection v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-confection

A collection of useful react stuff.

NPM JavaScript Style Guide

Install

npm install --save react-confection

Usage

import React, { Component } from 'react'

import {useInterval} from 'react-confection'


export default function() {
  const [count, setCount] = useState(0)


  useInterval(()=>{
    setCount(count+1)
  }, 1234)


  return <>
    <h2> useInterval </h2>
    
    <p>
      Just a perpetual timer that snuggles with React.  This one updates a counter every 1,234ms.
      <br />
      Count: {count}
    </p>
  </>
}

License

MIT © fingerskier