UNPKG

strapi-plugin-parent-child-relationships

Version:

Strapi plugin to create and manage parent-child relationships between content types using custom fields

15 lines (11 loc) 241 B
import { useEffect, useRef } from 'react'; /** * @type {<T>(value: T) => T | undefined} */ export const usePrev = (value) => { const ref = useRef(); useEffect(() => { ref.current = value; }, [value]); return ref.current; };