Skip to content

Commit

Permalink
Fix NextJS migration snippet (#5307)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Atharva Pise <[email protected]>
  • Loading branch information
3 people authored Nov 8, 2023
1 parent 32152cb commit 2596065
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/docs/en/guides/migrate-to-astro/from-nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,14 @@ Here's how to recreate that in `src/pages/index.astro`, replacing `getStaticProp

- The `<> </>` fragment is not required in Astro templating.

- `key` is a React attribute, and is not an attribute of `li` in Astro.

```astro title="src/pages/index.astro" "class" "</a>" "<a"
---
---
<ul class="plain-list pokeList">
{pokemons.map((pokemon) => (
<li class="pokemonListItem" key={pokemon.name}>
<li class="pokemonListItem">
<a class="pokemonContainer" href={`/pokemon/${pokemon.name}`}>
<p class="pokemonId">No. {pokemon.id}</p>
<img class="pokemonImage" src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${pokemon.id}.png`} alt={`${pokemon.name} picture`}/>
Expand Down

0 comments on commit 2596065

Please sign in to comment.