pokemon.jsx 504 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import {Route, Switch} from 'react-router-dom';
  3. import PokemonShow from './pokemon/show';
  4. import PokemonIndex from './pokemon/index';
  5. import NotFound from './not_found';
  6. function Pokemon({match}) {
  7. return (
  8. <>
  9. <Switch>
  10. <Route exact path={`${match.path}/:id`} component={PokemonShow} />
  11. <Route exact path={`${match.path}`} component={PokemonIndex} />
  12. <Route component={NotFound} />
  13. </Switch>
  14. </>
  15. );
  16. }
  17. export default Pokemon;