Lesson4 Saifutdinova Daria#41
Open
Makaino wants to merge 4 commits into
Open
Conversation
paxarpp
reviewed
Feb 2, 2019
| import './styles/style.css' | ||
| import WelcomeModal from './components/WelcomeModal'; | ||
|
|
||
|
|
paxarpp
reviewed
Feb 2, 2019
|
|
||
| class App extends Component { | ||
| render() { | ||
| const posts = [ |
paxarpp
reviewed
Feb 2, 2019
| ReactDOM.render (<App/>, document.querySelector('#root')); | ||
|
|
||
|
|
||
|
|
paxarpp
reviewed
Feb 2, 2019
| return ( | ||
| <div> | ||
| <Blog posts = {posts}/> | ||
| <WelcomeModal/> |
paxarpp
reviewed
Feb 2, 2019
|
|
||
| return ( | ||
| <div> | ||
| <Blog posts = {posts}/> |
paxarpp
reviewed
Feb 2, 2019
| ReactDOM.render (<App/>, document.querySelector('#root')); | ||
|
|
||
|
|
||
|
|
paxarpp
reviewed
Feb 2, 2019
|
|
||
| class Blog extends Component { | ||
| render() { | ||
| const items = this.props.posts.map((item, index) => |
There was a problem hiding this comment.
используйте const { post } = this.props;
paxarpp
reviewed
Feb 2, 2019
|
|
||
| class Post extends Component { | ||
| render() { | ||
| return (<div className='post'> |
paxarpp
reviewed
Feb 2, 2019
| } | ||
|
|
||
| static getDerivedStateFromProps(props, state) { | ||
| console.log('2') |
Contributor
Author
There was a problem hiding this comment.
Это я пишу для себя. что смотерть что в каком порядке срабатывает.
There was a problem hiding this comment.
при отладке конечно можно использовать, но пушить в ветку когда она готова с console нельзя
Contributor
Author
There was a problem hiding this comment.
да, спасибо поняла. по остальным замечаниям тоже все понятно.
paxarpp
reviewed
Feb 2, 2019
| if (this.state.modal) { | ||
| welcomeModule = <div className='modal'> | ||
| <img src="./src/app/components/TMNT.jpg" alt={"tmnt"}/> | ||
| <button className='button' onClick={() => { |
There was a problem hiding this comment.
лучше на onClick вешать вызов метода например this.onClose
а в нем уже менять state
paxarpp
reviewed
Feb 2, 2019
|
|
||
| componentDidMount() { | ||
| this.setState({modal: true}) | ||
| console.log('4') |
paxarpp
reviewed
Feb 2, 2019
| } | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.