Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SinglePokemon.tsx): Added missing keys to .map()'s #2

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const HomePage: React.FC = () => {
const [searchTerm, setSearchTerm] = useState<string>('');

useEffect(() => {
console.log('is this rendering');
const foundPoke = pokemonData.filter(pk => {
return pk.name.toLowerCase().includes(searchTerm.toLowerCase());
});
Expand All @@ -18,7 +17,6 @@ const HomePage: React.FC = () => {
// useEffect(()=>{},[])

const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
console.log(event.target.value);
setSearchTerm(event.target.value);
};

Expand Down
6 changes: 2 additions & 4 deletions src/pages/SinglePokemon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const SinglePokemonPage: React.FC = () => {
let foundPokemon = pokemonData.find(
pd => pd.name.toLowerCase() === pokemonName
);
console.log(foundPokemon);
setPokemon(updateEvolution(foundPokemon));
}, [pokemonName]);

Expand Down Expand Up @@ -45,7 +44,6 @@ const SinglePokemonPage: React.FC = () => {
});
}

console.log(poke);
return poke;
};
return (
Expand Down Expand Up @@ -112,7 +110,7 @@ const SinglePokemonPage: React.FC = () => {
<div className='row'>
{pokemon.prev_evolution?.map((pe, i) => {
return (
<div className='col'>
<div className='col' key={i}>
<h5 className='text-secondary'>
Previous Evolution
</h5>
Expand All @@ -127,7 +125,7 @@ const SinglePokemonPage: React.FC = () => {
})}
{pokemon.next_evolution?.map((ne, i) => {
return (
<div className='col'>
<div className='col' key={i}>
<h5 className='text-secondary'>Next Evolution</h5>
<div>
<Link to={`/pokemon/${ne.name.toLowerCase()}`}>
Expand Down