Skip to content

Commit 49f5415

Browse files
authored
Update useTraceUpdate.ts
1 parent 438e5c6 commit 49f5415

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

useTraceUpdate.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
/*
1+
import { RefObject, useRef, useEffect } from 'react';
2+
3+
/**
24
* Trace which props changed and caused the rerender
35
*/
4-
function useTraceUpdate(props: any): void {
6+
7+
export function useTraceUpdate(props: any): void {
58
const prev = useRef(props);
69
useEffect(() => {
710
const changedProps = Object.entries(props).reduce((ps, [k, v]) => {

0 commit comments

Comments
 (0)