UNPKG

@kiwicom/smart-faq

Version:

Smart FAQ

19 lines (14 loc) 422 B
// @flow import * as React from 'react'; import { StaticRouter, BrowserRouter } from 'react-router-dom'; import { isBrowser } from '../helpers'; type Props = { children: React.Node, }; const IsomorphicRouter = (props: Props) => isBrowser() ? ( <BrowserRouter {...props}>{props.children}</BrowserRouter> ) : ( <StaticRouter {...props}>{props.children}</StaticRouter> ); export default IsomorphicRouter;