Skip to content

Commit

Permalink
onClick should be updated when navigateToScreen is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw committed Jun 6, 2023
1 parent 6d637db commit f55f1b0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions settings/src/components/screen-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ export default function ScreenLink( {
classes.push( 'is-secondary' );
}

const onClick = useCallback( ( event ) => {
event.preventDefault();
navigateToScreen( { currentScreen, nextScreen } );
}, [] );
const onClick = useCallback(
( event ) => {
event.preventDefault();
navigateToScreen( { currentScreen, nextScreen } );
},
[ navigateToScreen ]
);

return (
<a
Expand Down

0 comments on commit f55f1b0

Please sign in to comment.