Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hooks passing callbacks
function App() {
// Notice the callback passed to component will be a new reference
// on every rerender for both the callbacks
function callback() {
// some logic
}
function callback2() {
// some logic
}
return <SomeChildComponent callback={callback} callback2={callback2} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment