'React - data "outside" component
I just using some tailwind components and i what is a please difference between have "data" inside component or outside component? What is difference in backgroud and better practice?
const people = [
{
name: 'Jane Cooper',
title: 'Regional Paradigm Technician',
},
{
name: 'Karl von etwas',
title: 'Regional Paradigm Technician',
},
]
export default function Example() {
return ( ....)
}
or
export default function Example() {
const people = [
{
name: 'Jane Cooper',
title: 'Regional Paradigm Technician',
},
{
name: 'Karl von etwas',
title: 'Regional Paradigm Technician',
},
]
return ( ....)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
