0.0.3 • Published 4 years ago

use-constructor v0.0.3

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

use-constructor

npm npm GitHub stars

react hook that behaves like a class constructor for functional components

Please ★ this repo if you found it useful ★ ★ ★

Installation

npm install --save use-constructor

Usage

import React, { FC } from 'react';
import useConstructor from 'use-constructor';

const Component: FC = () => {
  useConstructor(() => {
    console.log('component will mount');
  });

  return <></>;
}

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2020

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons