Skip to content

Implemented home task#1

Open
Danily07 wants to merge 1 commit intomainfrom
2_core_components
Open

Implemented home task#1
Danily07 wants to merge 1 commit intomainfrom
2_core_components

Conversation

@Danily07
Copy link
Owner

No description provided.

@Danily07 Danily07 requested a review from AlexandrBeznosov May 17, 2022 07:49
}, "Decrease"));
}

export default App;
Copy link
Collaborator

@AlexandrBeznosov AlexandrBeznosov May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В большинстве случаев лучше избегать дефолтного экспорта из модуля. Это приводит к потере контроля имени экспортируемого объекта, т.е. ты можешь импортнуть App (например в index.js) с любым именем:
import SHIT from './CreateElementComponent.js';
И это будет работать.
Другой кейс - ты переименовал экспортируемый объект в VS Code как обычно по F2, а там где ты его импортил останется старое имя.
Предпочтительнее использовать именованный импорт/экспорт:
export { App };
import { App } from './тыры-пыры';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants