Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Пётр Еремейкин. ДЗ по react #11

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

eremeykin
Copy link

No description provided.

Copy link
Owner

@AndreyGladkov AndreyGladkov left a comment

Choose a reason for hiding this comment

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

Ты молодец, спасибо за решение. Мне понравилось, что ты использовал materialUI, наследовался от PureComponent, думая о производительности =).Поделил на компоненты, которые можно было описать в отдельных модулях. Использовал Fragment и ref callback о которых мы не говорили на лекции. Мои комментарии, касаются не react части по большей части и носят информационный характер.

};

doFetch = (reqId) => {
let self = this;
Copy link
Owner

Choose a reason for hiding this comment

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

это лишнее, используй синтаксический bind, если нужно привязать контекст.

}));
})
.catch((error) => {
self.setState(state => ({
Copy link
Owner

Choose a reason for hiding this comment

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

вот тут у тебя как раз будет this, выше делай тоже синтаксический bind.

@@ -0,0 +1,40 @@
import React, {PureComponent, Component} from "react";

export default class Logs extends Component {
Copy link
Owner

Choose a reason for hiding this comment

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

Можно просто Function Component


render() {
return (
<Fragment>
Copy link
Owner

Choose a reason for hiding this comment

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

Fragment в данном месте лишний.

return (
<Fragment>
<div id="toolbox" className="toolbox">
<Input className={"searchInput"} inputRef={input => (this.input = input)}/>
Copy link
Owner

Choose a reason for hiding this comment

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

Для информации можно, использовать React.createRef.

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