@reach/router#Redirect JavaScript Examples

The following examples show how to use @reach/router#Redirect. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js    From hooks-workshop with MIT License 6 votes vote down vote up
App = () => (
  <div>
    <nav className={styles.nav}>
      <Link to="meme-creator" getProps={isActive}>Meme Creator</Link>
      <Link to="star-wars-info" getProps={isActive}>Star Wars Info</Link>
      <Link to="personal-blog" getProps={isActive}>Personal Blog</Link>
    </nav>
    <Router>
      <MemeCreator path="meme-creator" />
      <StarWarsInfo path="star-wars-info" />
      <PersonalBlog path="personal-blog/*" />
      <Redirect from="/" to="meme-creator" noThrow />
    </Router>
  </div>
)
Example #2
Source File: ebpf-summit-2021-cfp.js    From ebpf.io-website with Creative Commons Attribution 4.0 International 6 votes vote down vote up
SummitPage = () => <>
  <div style={{display: 'grid', placeItems: 'center', height: '100vh', fontSize: '1.5rem'}}>
    <div style={{textAlign: 'center'}}>
      Redirecting to <a href="https://ebpf.io/summit-2021" style={{color: '#4385F5'}}>https://ebpf.io/summit-2021</a>…
    </div>
  </div>

  <Redirect noThrow to={`/summit-2021`} />
</>
Example #3
Source File: ebpf-summit-2020-cfp.js    From ebpf.io-website with Creative Commons Attribution 4.0 International 6 votes vote down vote up
SummitPage = () => <>
  <div style={{display: 'grid', placeItems: 'center', height: '100vh', fontSize: '1.5rem'}}>
    <div style={{textAlign: 'center'}}>
      Redirecting to <a href="https://ebpf.io/summit-2020" style={{color: '#4385F5'}}>https://ebpf.io/summit-2020</a>…
    </div>
  </div>

  <Redirect noThrow to={`/summit-2020`} />
</>
Example #4
Source File: index.js    From hitw-landing-page with MIT License 6 votes vote down vote up
TrackAndRedirect = ({ release, to }) => {
  const [shouldRedirect, setShouldRedirect] = React.useState(false);

  React.useEffect(() => {
    if (!shouldRedirect) {
      trackEvent(trackEvent.EVENT__CONVERSION__REDIRECT, {
        release,
        url: to,
      });
      setTimeout(() => setShouldRedirect(true), 100);
    }
  }, [release, shouldRedirect, to]);
  return shouldRedirect ? <Redirect to={to} noThrow /> : null;
}
Example #5
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}fees/`} noThrow />
}
Example #6
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}dao/`} noThrow />
}
Example #7
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}overview/`} noThrow />
}
Example #8
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}factory/`} noThrow />
}
Example #9
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}using-the-api/`} noThrow />
}
Example #10
Source File: smart-contract-architecture.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`/docs/honeyswap/protocol-overview/smart-contracts`} noThrow />
}
Example #11
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}quick-start/`} noThrow />
}
Example #12
Source File: Integration-quick-start.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`/docs/honeyswap/smart-contract-integration/quick-start`} noThrow />
}
Example #13
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}swaps/`} noThrow />
}
Example #14
Source File: Whitepaper.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`/whitepaper.pdf`} noThrow />
}
Example #15
Source File: Core-concepts.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`/docs/honeyswap/core-concepts`} noThrow />
}
Example #16
Source File: Advanced-topics.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`/docs/honeyswap/advanced-topics/`} noThrow />
}
Example #17
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}how-uniswap-works/`} noThrow />
}
Example #18
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}intro/`} noThrow />
}
Example #19
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}community-covenant/`} noThrow />
}
Example #20
Source File: index.js    From about-1hive with GNU General Public License v3.0 5 votes vote down vote up
export default function Redirector({ path }) {
  return <Redirect from={path} to={`${path}getting-started/`} noThrow />
}