#
useEffectExceptFirstRender
The useEffectExceptFirstRender
hook is a custom React hook designed to execute an effect function after the initial render, excluding the first render.
#
Usage
import { useEffectExceptFirstRender } from "hookverse";
useEffectExceptFirstRender(func, deps);
#
Parameters
#
Example
import React from "react";
import { useEffectExceptFirstRender } from "hookverse";
const ExampleComponent = () => {
useEffectExceptFirstRender(
() => {
// Your effect function
console.log("Effect executed except on the first render");
},
[
/* dependencies */
]
);
// Rest of your component logic
return <div>{/* Your JSX content */}</div>;
};
export default ExampleComponent;
In this example, the effect function will be executed on every render except the first one.