Skip to content

Conversation

@anutaguzova
Copy link
Owner

  1. Task - https://github.com/rolling-scopes-school/tasks/blob/master/tasks/react/react-components.md
  2. Deploy https://task-1-react-components.netlify.app/

Screenshot 2021-08-31 at 23 45 55

  1. задание выполнено: - сборка; - компоненты Card и Search bar

src/App.tsx Outdated
map: 'https://goo.gl/maps/abDoKFxqoc66ptWt5',
like: '850',
eye: '950',
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Необходимо вынести данные для карточек в отдельный файл, такие данные не хранятся в state

Copy link
Owner Author

Choose a reason for hiding this comment

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

исправлено

src/App.tsx Outdated
<Search />
<div className="card-container">
{this.state.card.map((card) => {
return <Card card={card} key={card.country + Math.random()} />;
Copy link
Collaborator

@KseniyaYatskevich KseniyaYatskevich Sep 5, 2021

Choose a reason for hiding this comment

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

Молодец что добавила key={card.country + Math.random()}, тем самым ты избавилась от ошибки в консоли. Но использование Math.random() плохая практика. Можно было добавить id к карточкам, но так тоже можно.

@@ -0,0 +1,35 @@
export function Card(props) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Стоит использовать деструктуризацию для props:
export function Card({card})

Copy link
Owner Author

Choose a reason for hiding this comment

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

исправила

"main": "index.js",
"scripts": {
"start": "webpack serve --config webpack/webpack.config.js --env env=dev",
"build": "webpack --config webpack/webpack.config.js --env env=prod",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Есть скрипт для prod сборки, но нет скрипта для dev сборки

Copy link
Owner Author

Choose a reason for hiding this comment

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

добавила

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.

3 participants