@hoook/use-file
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

React use file hook

This is true use file hook for browser, you don't have to need a input element to handle event, just focus on your UI component.

Usage

import React from 'react';
import { useFile } from '@hoook/use-file';

export default function() {
  const [trigger, content] = useFile();

  return (
    <div>
      <div onClick={() => trigger()}>Whatever your trigger is</div>
      <p>{content}</p>
    </div>
  );
}

Package Sidebar

Install

npm i @hoook/use-file

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

11.4 kB

Total Files

11

Last publish

Collaborators

  • kaivnd