Skip to content

Commit

Permalink
make AppRouterAnnouncer resilient to Strict Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Aug 21, 2023
1 parent fd2d6f4 commit 9b2dd4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/client/components/app-router-announcer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {

// Only announce the title change, but not for the first load because screen
// readers do that automatically.
if (previousTitle.current !== undefined) {
if (
previousTitle.current !== undefined &&
previousTitle.current !== currentTitle
) {
setRouteAnnouncement(currentTitle)
}
previousTitle.current = currentTitle
Expand Down

0 comments on commit 9b2dd4b

Please sign in to comment.