useDidMount
Aboutβ
componentDidMount hook for React
Installationβ
npm install --save rooks
Importing the hookβ
import { useDidMount } from "rooks";
Usageβ
function Demo() {
useDidMount(function () {
console.log("mounted");
});
return null;
}
render(<Demo />);
Argumentsβ
Argument | Type | Description |
---|---|---|
callback | function | function to be called on mount |
Codesandbox Examplesβ
Basic Usageβ
Join Bhargav's discord serverβ
You can click on the floating discord icon at the bottom right of the screen and talk to us in our server.