import { useEffect, useRef } from'react';/** Pass dictionary of `props` as argument and it will * tell you, which one changed after rerender. * Use `prefix` to distinguish props of different components. */// eslint-disable-next-line import/no-unused-modulesexportconstuseWhatsChanged= (props:Record<string, unknown>,prefix='',) => {constprevProps=useRef(props);useEffect(() => {Object.entriesif (prevProps.current[key] !==value ) {// eslint-disable-next-line no-consoleconsole.log(`${prefix} ${key} has changed`); } });prevProps.current=props; }, [props, prefix]);};