PrivateRoute.js 435 B

123456789101112131415161718192021222324252627
  1. import React, { Component } from 'react';
  2. import { Route, Redirect } from "react-router-dom";
  3. export default ({ component: Component, data, params, ...rest }) =>(
  4. <Route
  5. {...rest}
  6. render= {props =>{
  7. return <Component {...data} {...props} />
  8. }}
  9. />
  10. )