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

質問編集履歴

1

誤字、文法の修正

2019/11/11 22:19

投稿

kata.
kata.

スコア6

title CHANGED
File without changes
body CHANGED
@@ -27,9 +27,9 @@
27
27
  import './App.css';
28
28
 
29
29
  class App extends Component{
30
-
30
+
31
31
  data = [];
32
-
32
+
33
33
  msgStyle = {
34
34
  fontSize: "24px",
35
35
  color: "#900",
@@ -56,7 +56,7 @@
56
56
  };
57
57
  this.doAction = this.doAction.bind(this);
58
58
  this.doshapeA = this.doshapeA.bind(this);
59
- this.doshapeA = this.doshapeB.bind(this);
59
+ this.doshapeB = this.doshapeB.bind(this);
60
60
  }
61
61
 
62
62
  doAction(e){
@@ -69,10 +69,10 @@
69
69
  }
70
70
 
71
71
  doshapeA(){
72
- this.setState(() => ({
72
+ this.setState({
73
73
  flgA: true,
74
74
  flgB: false
75
- }));
75
+ });
76
76
  }
77
77
 
78
78
  doshapeB(){
@@ -89,7 +89,7 @@
89
89
  top:(d.y - 10) + "px",
90
90
  };
91
91
  //ここでtrue falseを判定
92
- const input = (this.state.flgA) ? <div style={s}>図形A</div> : <div style={s}>図形B</div>;
92
+ const input = (this.state.flgA) ? <div style={s}><i class="fa fa-heart">A</i></div> : <div style={s}>図形B<i class="fa fa-star">い</i></div>;
93
93
  return <div>{input}</div>;
94
94
  }
95
95