Skip to content

Instantly share code, notes, and snippets.

import { useEffect, useRef } from 'react';
/**
* A small utility hook to help figure out what is changing and causing
* re-renders. Add it to the component you're investigating and pass in a object
* of the values that you think might be changing.
*
* Ex: useWhatChanged({ someProp, someOtherProp });
*/
export function useWhatChanged(props) {