1.2.2 • Published 3 years ago

use-random-number v1.2.2

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

use-random-number

generate random number

NPM JavaScript Style Guide

Install

npm install --save use-random-number

Usage

// import React, { Component } from 'react'

// import { useMyHook } from 'use-random-number'

// const Example = () => {
//   const example = useMyHook()
//   return (
//     <div>{example}</div>
//   )
// }
import React from "react";
import { useRandomNumber } from "use-random-number";

function Example() {
  const [randomNum, getRandomNumber, initValue] = useRandomNumber();

  return (
    <div>
      Random Number: {randomNum}
      <button type="button" onClick={getRandomNumber}>
        Random Number
      </button>
      <button type="button" onClick={initValue}>
        Initial Value: {initValue}
      </button>
    </div>
  );
}
export default Example;

License

MIT © shrutinandan


This hook is created using create-react-hook.

1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago