Files
bee-dashboard/src/routes/AppRoute.tsx
T
Vojtech Simetka bc01d60728 style: add eslint configuration and fixed linter issues (#35)
* style: add eslint configuration as per bee-js

* chore: add `plugin:react/reocommended` in `.eslintrc`

Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com>

* chore: add `consistent` to `array-bracket-newline` as per review

* style: after automatic fixes with `npm run lint`

* style: fixed all linter errors

* refactor: fixed all linter warnings

* chore: added missing new line at end of `.prettierrc` file

Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com>
2021-04-03 14:04:37 +02:00

24 lines
570 B
TypeScript

import type { JSXElementConstructor, ReactElement } from 'react'
import { Route, RouteComponentProps } from 'react-router-dom'
interface Props {
component: JSXElementConstructor<RouteComponentProps>
layout: JSXElementConstructor<RouteComponentProps>
exact?: boolean
path: string
}
const AppRoute = ({ component: Component, layout: Layout, exact, path }: Props): ReactElement => (
<Route
exact={exact}
path={path}
render={props => (
<Layout {...props}>
<Component {...props} />
</Layout>
)}
/>
)
export default AppRoute