~/components vs ~/components/Button
Any opinions on this? Does A affect performance? (importing from a file that exports many other components)
A
B
A
// ~/components/index.ts
export { default as Button } from './Button'
export { default as Label } from './Label'
export { default as Toggle } from './Toggle'
// ~/components/Button/Button.tsx
export default function Button() { return <button /> }
// ~/components/Button/index.ts
export { default } from './Button'
// ~/pages/index.tsx
import { Button, Label } from '~/components'// ~/components/index.ts
export { default as Button } from './Button'
export { default as Label } from './Label'
export { default as Toggle } from './Toggle'
// ~/components/Button/Button.tsx
export default function Button() { return <button /> }
// ~/components/Button/index.ts
export { default } from './Button'
// ~/pages/index.tsx
import { Button, Label } from '~/components'B
// ~/components/Button/Button.tsx
export default function Button() { return <button /> }
// ~/components/Button/index.ts
export { default } from './Button'
// ~/pages/index.tsx
import Button from '~/components/Button'
import Label from '~/components/Label'// ~/components/Button/Button.tsx
export default function Button() { return <button /> }
// ~/components/Button/index.ts
export { default } from './Button'
// ~/pages/index.tsx
import Button from '~/components/Button'
import Label from '~/components/Label'