877 viewsMern Amazona

Uncaught Error: Cannot include a ‘?’ character in a manually specified `to.pathname` field [{“pathname”:”/search?category=all&query=shirt&price=all&rating=all&order=newest&page=1″}]. Please separate it out to the `to.search` field. Alternatively you may provide the full path as a string in <Link to=”…”> and the router will parse it for you.
at invariant (utils.ts:757:1)
at resolveTo (utils.ts:853:1)
at hooks.tsx:311:1
at mountMemo (react-dom.development.js:17227:1)
at Object.useMemo (react-dom.development.js:17672:1)
at Object.useMemo (react.development.js:1652:1)
at useResolvedPath (hooks.tsx:311:1)
at useHref (hooks.tsx:61:1)
at LinkContainer (LinkContainer.js:49:1)
at renderWithHooks (react-dom.development.js:16307:1)

Bassir Changed status to publish November 26, 2023

in line 129 .. remove the ? from                 <LinkContainer                   to={`/search?category=${category}`} so change it to { ‘/searchcategory=${category}’ }

MB Edited answer November 4, 2022

in line 129 change

                <LinkContainer
                  to={`/search?category=${category}`}

to  to={/searchcategory=${category}`}

MB Answered question November 4, 2022