Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created October 6, 2020 18:27
Show Gist options
  • Save matiasfha/ade48b613d2aa7dc7ec1456f8ef51a3f to your computer and use it in GitHub Desktop.
Save matiasfha/ade48b613d2aa7dc7ec1456f8ef51a3f to your computer and use it in GitHub Desktop.
const DummyComp = ({datos}) =>{
return <ul>
{datos.map((campeon)=>(
<li>{campeon.name}</li>
))}
</ul>
}
@matiasfha
Copy link
Author

En caso de que el arreglo datos tenga una forma tipo

[{ Nombre1: {}, Nombre2:{}]

Se puede usar
`

const DummyComp = ({datos}) =>{

return <ul>
    {datos.map((campeon, i)=>(
        <li>{campeon[i].name}</li>
    ))}
    </ul>

}

`
O combinar map con Object.keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment