1
0
Fork 0

Additional ? check

This commit is contained in:
Lim Chee Aun 2023-09-09 17:20:31 +08:00
parent 6b5a98ebb3
commit 886d78bde8

View file

@ -21,7 +21,7 @@ const Link = forwardRef((props, ref) => {
const { to, ...restProps } = props;
// Handle encodeURIComponent of searchParams values
if (!!hash && hash !== '/') {
if (!!hash && hash !== '/' && hash.includes('?')) {
const parsedHash = new URL(hash, location.origin); // Fake base URL
if (parsedHash.searchParams.size) {
const searchParamsStr = Array.from(parsedHash.searchParams.entries())