An useEffect that does not run on first render
npm install @rooks/use-update-effect```
npm install rooks
or
``
yarn add rooks
Rooks is completely treeshakeable and if you use only 1 of the 50+ hooks in the package, only that hook will be bundled with your code. Your bundle will only contain the hooks that you need. Cheers!
!Build Status   
An useEffect that does not run on first render
``
npm install --save @rooks/use-update-effect
`javascript`
import useUpdateEffect from "@rooks/use-update-effect";
` Has updated for userID - {hasUpdated.toString()}jsx
function Demo() {
const [userID, setUserID] = useState();
const [hasUpdated, setHasUpdated] = useState({ userID, updated: false });
useUpdateEffect(() => {
API.subscribe(userID);
setHasUpdated({ userID, updated: true });
() => {
API.unsubscribe(userID);
setHasUpdated({ userID, updated: false });
};
}, [value]);
return (
<>
>
);
}
render(
``