-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Risk feed #1197
✨ Risk feed #1197
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! added some minor comments, feel free to ignore them.
will approve after final design impl.
useEffect(() => { | ||
funcRef.current = fn; | ||
}, [fn]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every time fn
changes, the value of funcRef.current
also changes because of the useEffect
. So funcRef.current
always reflects the most recent value of fn
. I believe you could use fn
directly instead of maintaining and updating a separate reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that would trigger the effect, on every fn
change (even if it's the same func defined inline), this is just a minor thing to avoid having to wrap the call with useCallback
closes #1192
/activity
. There is no link in the app to it stillPreview of page