use-constructor
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i use-constructor

Weekly Downloads

15

Version

0.0.3

License

MIT

Unpacked Size

7.16 kB

Total Files

6

Last publish

Collaborators

  • codejamninja