-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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 => ({ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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)}/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для информации можно, использовать React.createRef
.
No description provided.