回答編集履歴
1
回答の趣旨という観点で不要なコードを除去
answer
CHANGED
@@ -37,24 +37,13 @@
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
|
40
|
-
|
41
40
|
class YourClassName extends React.Component {
|
42
41
|
constructor(props) {
|
43
42
|
super(props);
|
44
|
-
this.state = {
|
43
|
+
this.state = {};
|
45
|
-
cssstyle: false,
|
46
|
-
};
|
47
44
|
}
|
48
|
-
|
49
|
-
|
45
|
+
|
50
|
-
elm.classList.toggle('cssstyle');
|
51
|
-
};
|
52
|
-
|
53
46
|
render() {
|
54
|
-
const cssstyle= ClassNames({
|
55
|
-
[theme.cssstyle]: this.state.cssstyle,
|
56
|
-
});
|
57
|
-
|
58
47
|
return (
|
59
48
|
<section>
|
60
49
|
<YourDiv classes={['Other', 'Classes']} tetxtContent='ボタン1' />
|