0

I wouldlike to redirect in another page when I click on one button of my menu :

<HeaderLink to="http://google.com" activeClassName="active-page">
          <NavText
              variant="h6"
              noWrap
              component="div"
          >
            Redirect
          </NavText>
        </HeaderLink>
        

const HeaderLink = styled(NavLink)(({ theme }) => ({
  display: 'flex',
  position: 'relative',
  justifyContent: 'center',
  alignItems: 'center',
...

but get an error. I can't redirect to google.

1 Answers1

0

You can try like this

<HeaderLink
  to={{ pathname: "https://google.com" }}
  activeClassName="active-page"
>
  <NavText variant="h6" noWrap component="div">
    Redirect
  </NavText>
</HeaderLink>;
Lahcen
  • 1,231
  • 11
  • 15