Add error message to useWhyDidYouUpdate
This commit is contained in:
parent
4ad764a2b2
commit
2712375ae9
|
|
@ -9,6 +9,10 @@ export function useWhyDidYouUpdate(name: string, props: any) {
|
|||
const previousProps = useRef({});
|
||||
|
||||
useEffect(() => {
|
||||
console.error(
|
||||
'useWhyDidYouUpdate should not be used in production code. It is intended for debugging purposes only.'
|
||||
);
|
||||
|
||||
if (previousProps.current) {
|
||||
const allKeys = Object.keys({ ...previousProps.current, ...props });
|
||||
const changedProps: any = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue