react hook that behaves like a class constructor for functional components
Please ★ this repo if you found it useful ★ ★ ★
npm install --save use-constructor
import React, { FC } from 'react';
import useConstructor from 'use-constructor';
const Component: FC = () => {
useConstructor(() => {
console.log('component will mount');
});
return <></>;
}
Submit an issue
Contribute a screenshot
Review the guidelines for contributing
Jam Risser © 2020
Review the changelog
- Jam Risser - Author
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!