Created
March 4, 2018 14:18
-
-
Save iktakahiro/dee8a4a1a99de4144a27c94ed3adda28 to your computer and use it in GitHub Desktop.
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
// --- 最上部のブロック | |
// state を変更するメソッド | |
setShouldReload = (shouldReload) => { | |
this.setState({shouldReload}) | |
} | |
// --- 左上のブロック | |
<MessageForm setShouldReload={this.setShouldReload} /> | |
// ーー 右上のブロック | |
<MessageFeed | |
shouldReload={this.state.shouldReload} | |
setShouldReload={this.setShouldReload} /> | |
// -- 左下のブロック | |
postMessage = () => { | |
// 受け取ったメソッドを実行 | |
this.props.setShouldReload(true) | |
} | |
// -- 右下のブロック | |
componentDidUpdate(prevProps) { | |
// shouldReload が変化した場合の処理 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment