Miss any of our Open RFC calls?Watch the recordings here! »

simple-react-button

2.0.0 • Public • Published

Button Component

A simple ReactJS Button component.

Install

$ npm install simple-react-button --save

Usage

import React, { useCallback } from 'react';
import Button from 'simple-react-button';
 
const YourComponent = () => {
  const onTestClick = useCallback((event) => {
    return fetch().then(doSomething);
  }, []);
 
  return (
    <div>
      <Button onClick={onTestClick}>
        Button text
      </Button>
    </div>
  );
};
 
export default YourComponent;
 

Props

interface IButtonProps {
  type?: 'button' | 'submit' | 'reset';
  disabled?: boolean;
  className?: string;
  onClick: <T>(event: React.MouseEvent<HTMLButtonElement>) => void | Promise<T>;
}

License

MIT

Install

npm i simple-react-button

DownloadsWeekly Downloads

12

Version

2.0.0

License

MIT

Unpacked Size

3.32 kB

Total Files

5

Last publish

Collaborators

  • avatar