(props: Record<string, any>)
| 16 | export function noop() {} |
| 17 | |
| 18 | export function useTraceUpdate(props: Record<string, any>) { |
| 19 | const prev = useRef(props); |
| 20 | useEffect(() => { |
| 21 | const changedProps = Object.entries(props).reduce((ps, [k, v]) => { |
| 22 | if (prev.current[k] !== v) { |
| 23 | (ps as any)[k] = [prev.current[k], v]; |
| 24 | } |
| 25 | return ps; |
| 26 | }, {}); |
| 27 | if (Object.keys(changedProps).length > 0) { |
| 28 | console.log('Changed props:', changedProps); |
| 29 | } |
| 30 | prev.current = props; |
| 31 | }); |
| 32 | } |
nothing calls this directly
no outgoing calls
no test coverage detected