'How to correctly write the path(useNavigate)?

please help. I have such a route, how to correctly specify the path in the navigate before it

  if (data) { navigate({`MainPage/repos/users:${inputValue}/page/`}); } 



  <Route
      path={`MainPage/repos/users:${inputValue}/page/`}
      element={(
        <MainPage
          userProfile={userProfile}
          loading={loading}
          reposRef={reposRef}
          setinputValue={setinputValue}
          githubPageref={githubPageref}
          findUser={findUser}
          getMoreRepos={getMoreRepos}
          pageSize={pageSize}
        />
      )}
    />


Solution 1:[1]

I believe you don't need to pass braces in navigate, try this:

if (data) { navigate(`MainPage/repos/users:${inputValue}/page/`); } 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Georgy