Skip to content
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

feat: add useCallOnce hook #1750

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AbdUlHamedMaree
Copy link

Adding useCallOnce hook

Call the passed function once in the component lifecycle,

unlike useMemo that even when you pass empty deps it might call your callback again (check last sentence in react docs),

that's why some libraries use useState to call function once in the component lifecycle

Copy link

codesandbox bot commented May 7, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented May 7, 2024

@AbdUlHamedMaree is attempting to deploy a commit to the Rooks Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

stale bot commented Jul 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant