Index.tsx 515 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import {AppPokemonIndexQueryResponse} from '../../../__generated__/AppPokemonIndexQuery.graphql';
  3. import PokemonShow from './Show';
  4. function PokemonIndex(
  5. props: AppPokemonIndexQueryResponse
  6. ): React.ReactElement<void> {
  7. return (
  8. <ul>
  9. {props.pokemonConnection.edges.map(
  10. (edge): React.ReactNode => (
  11. <li key={edge.node.id}>
  12. <PokemonShow pokemon={edge.node} />
  13. </li>
  14. )
  15. )}
  16. </ul>
  17. );
  18. }
  19. export default PokemonIndex;