質問するログイン新規登録

回答編集履歴

3

0

2018/02/13 09:54

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -17,7 +17,7 @@
17
17
  global.setTimeout(() => {
18
18
  console.log(this.toph.clientHeight)
19
19
  this.setState({ height: this.toph.clientHeight })
20
- })
20
+ }, 0)
21
21
  }
22
22
 
23
23
  clicks = () => {

2

修正

2018/02/13 09:54

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  componentDidMount() {
17
17
  global.setTimeout(() => {
18
- console.log(test.clientHeight)
18
+ console.log(this.toph.clientHeight)
19
19
  this.setState({ height: this.toph.clientHeight })
20
20
  })
21
21
  }

1

修正

2018/02/13 09:53

投稿

mpyw
mpyw

スコア5223

answer CHANGED
@@ -31,7 +31,7 @@
31
31
  render() {
32
32
  return (
33
33
  <section>
34
- <div ref={assignRefOfToph} onClick={this.clicks}>
34
+ <div ref={this.assignRefOfToph} onClick={this.clicks}>
35
35
  a<br />b
36
36
  </div>
37
37
  <Contents />