github.com/Jeffail/benthos/v3@v3.65.0/website/src/exports/redirect.js (about)

     1  import React from 'react';
     2  import {Redirect} from '@docusaurus/router';
     3  
     4  function To(props) {
     5    let {location} = props;
     6    let {to, forComponent} = props.dest;
     7  
     8    if ( forComponent ) {
     9      if ( location.hash && location.hash.length > 1 ) {
    10        to = to + location.hash.slice(1);
    11      } else {
    12        to = to + '/about';
    13      }
    14    }
    15  
    16    return <Redirect to={to} />
    17  }
    18  
    19  export default To;