Just a curiosity and I couldn't find an answer to it on SO. Does it matter where I place a variable/dataset in respect to a react component? To clarify, the dataset is going to be only used in that component. If it does matter, I'm wondering if it has to do with performance or it's just a convention/good practice kind of thing.
import React from 'react'
export const Component: React.FC = () => {
const dataSet: string[] = [...]
return (
<div className='work-experiences'>
</div>
)
}
VS.
import React from 'react'
const dataSet: string[] = [...]
export const Component: React.FC = () => {
return (
<div className='work-experiences'>
</div>
)
}