The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { type DependencyList, type EffectCallback, useEffect } from 'react';
import { useFirstMountState } from './useFirstMountState';
export const useUpdateEffect = (
effect: EffectCallback,
deps?: DependencyList,
) => {
const isFirst = useFirstMountState();
useEffect(() => {
if (!isFirst) {
return effect();
}
// oxlint-disable-next-line react-hooks/exhaustive-deps
}, deps);
};