packageDocumentation module import * as React from "react" ; import { SendContext , StateMachineContext } from "../../components/SendContext" ; internal export const RedirectWithSend = ( props ) => { React . useEffect ( ( ) => { console . warn ( `Redirecting to: ${ props . to }` ) ; props . send ( { type : "GOTO" , route : `${ props . to }` } ) ; } , [ props . to , props . send ] ) ; return null ; } ; /**
 * React prop types for the [[Redirect]] component.
 */ export interface PropsRedirect { /** Path or url to redirect to */ to : string ; } param props const Redirect = ( props ) => { const { send } = React . useContext ( SendContext ) ; return ( < RedirectWithSend { ... props } send = { send } / > ) ; } ; export default Redirect ;