react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Beta] Better imports for icon components

Open Rec0iL99 opened this issue 3 years ago • 0 comments

Creating an index.ts file in components/Icon that would just import all the icon components and export them.

// components/Icon/index.ts
import {IconCopy} from './IconCopy';

export {IconCopy};

Why do this?

The old import

import {IconCopy} from '../Icon/IconCopy';

would then be replaced with

import {IconCopy} from '../Icon';

thus creating a better readable code.

Rec0iL99 avatar Aug 05 '22 18:08 Rec0iL99