fix(ui): stale locale value from useLocale (#9582)

### What?
Fixes issue with stale locale from searchParams

### Why?
Bad use of useEffect/useState inside our useSearchParams provider.

### How?
Memoize the locale instead of relying on the useEffect which was causing
unnecessary renders with stale values.
This commit is contained in:
Jarrod Flesch
2024-12-04 14:00:17 -05:00
committed by GitHub
parent 2321970fcc
commit fa7ed3f621
11 changed files with 68 additions and 82 deletions

View File

@@ -112,7 +112,7 @@ export const generateReleaseNotes = async (args: Args = {}): Promise<ChangelogRe
return sections
},
{} as Record<Sections | 'breaking', GitCommit[]>,
{} as Record<'breaking' | Sections, GitCommit[]>,
)
// Sort commits by scope, unscoped first