Skip to content

NikitaMudriy_lesson8#72

Open
randomgh wants to merge 1 commit into
LeonEsquire:masterfrom
randomgh:lesson-8
Open

NikitaMudriy_lesson8#72
randomgh wants to merge 1 commit into
LeonEsquire:masterfrom
randomgh:lesson-8

Conversation

@randomgh

Copy link
Copy Markdown
Contributor

No description provided.

setUsers(response.data);
});

return () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

в данном случае нет смысла возвращать return, так как массив и так пропадет вместе с компонентом, когда произойдет демонтирование. Но вы это могли написать, чтобы продемонстрировать понимание работы функции useEffect(), поэтому не жалуюсь)

<p>{props.phone}</p>
<p>{props.website}</p>
</div>
</div>;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

лучше прописывать название компонента, а потом ниже экспортировать его.

const MyComponent = props => {
    ...
}
export default MyComponent

далее дополнительным функционалом компонент будет легче дополнять, ну и такой код легче читать (так как привычнее 😄 )

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