react-components-encoded
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

react-components-encoded

A lib of components i commonly re-use in my projects

NPM JavaScript Style Guide

Install

npm install --save react-components-encoded

Usage

DelayedInput

Delay the call to onChange as long as user is typing or delay ends

import React, { useState, useEffect } from 'react'
import { DelayedInput } from 'react-components-encoded'

export default function DelayedInputExample() {
  const [value, setValue] = useState('')

  useEffect(() => {
    console.log(`Value has changed to ${value} !`)
  }, [value])

  return (
    <div>
      <label htmlFor="demo-delayed-input">DelayedInput </label>
      <DelayedInput 
        id="demo-delayed-input"
        onChange={setValue}
        // value={value} // optional default is an empty string
        // delay = 1000 // optional, Delay in ms default is 750
        // type = "range" // optional default is "text"
        // all other props are passed down to the jsx input element
      />
    </div>
  )
}

License

GNU GPLv3 © Encoded77

Readme

Keywords

none

Package Sidebar

Install

npm i react-components-encoded

Weekly Downloads

0

Version

1.0.0

License

GNU GPLv3

Unpacked Size

75.1 kB

Total Files

10

Last publish

Collaborators

  • eincoded