chore: [app dir bootstrapping 4] check nullability of navigation hook return values (#12005)

This commit is contained in:
Greg Pabian authored and GitHub committed 2023-10-20 16:47:05 -07:00
1 parent eac45c5e23
commit 39cfe18ffe
28 files changed
+114 -86

No files matched your search

@@ -222,9 +222,9 @@ const PremiumTextfield = (props: ICustomUsernameProps) => {
onChange={(event) => {
event.preventDefault();
// Reset payment status
const _searchParams = new URLSearchParams(searchParams);
const _searchParams = new URLSearchParams(searchParams ?? undefined);
_searchParams.delete("paymentStatus");
if (searchParams.toString() !== _searchParams.toString()) {
if (searchParams?.toString() !== _searchParams.toString()) {
router.replace(`${pathname}?${_searchParams.toString()}`);
}
setInputUsernameValue(event.target.value);