2
I have a constant:
const dados = [{
id: 1,
nome: 'Juliano',
idade: 25,
descricao: 'Front-end',
}, {
id: 2,
nome: 'Italo',
idade: 29,
descricao: 'Back-end',
}]
I export all this constant, via: export { data }; but I don’t know how to consume it in a separate component, as I would need to leave it as follows:
<h1>{dados.nome}</h1>
<h2>{dados.idade}</h2>
<h3>{dados.descricao}</h3>
However I do not know the syntax to consume it after imported, with the:
import dados from './dados.jsx'
Perfect thank you very much Maycon; it went all right, I was forgetting the syntax that is used to consume it.
– Juliano Gomes
Massa Juliano, I’m happy to help
– Maycon F. Castro