回答編集履歴

2

a

2018/07/01 09:50

投稿

HayatoKamono
HayatoKamono

スコア2415

test CHANGED
@@ -32,6 +32,18 @@
32
32
 
33
33
  <style jsx>{`
34
34
 
35
+ .App {
36
+
37
+ color: blue;
38
+
39
+ font-size: 12px;
40
+
41
+ background: #ccc;
42
+
43
+ padding: 5px;
44
+
45
+ }
46
+
35
47
  .test {
36
48
 
37
49
  color: red;
@@ -64,6 +76,8 @@
64
76
 
65
77
 
66
78
 
79
+
80
+
67
81
  ```
68
82
 
69
83
 

1

1

2018/07/01 09:50

投稿

HayatoKamono
HayatoKamono

スコア2415

test CHANGED
@@ -7,3 +7,69 @@
7
7
 
8
8
 
9
9
  これだけが原因かはわかりませんが、とりあえず、`:`であるべきところが、`;`になっているようです。
10
+
11
+
12
+
13
+ # 追記
14
+
15
+
16
+
17
+ ```
18
+
19
+ import React from "react";
20
+
21
+ import ReactDOM from "react-dom";
22
+
23
+
24
+
25
+ const HeadingPresenter = ({ tag: Tag, className, ...props }) => {
26
+
27
+ return (
28
+
29
+ <div className="App">
30
+
31
+ <Tag className={`test`}>Hello CodeSandbox</Tag>
32
+
33
+ <style jsx>{`
34
+
35
+ .test {
36
+
37
+ color: red;
38
+
39
+ font-size: 50px;
40
+
41
+ font-weight: normal;
42
+
43
+ }
44
+
45
+ `}</style>
46
+
47
+ </div>
48
+
49
+ );
50
+
51
+ }
52
+
53
+
54
+
55
+ const rootElement = document.getElementById("root");
56
+
57
+ ReactDOM.render(
58
+
59
+ <HeadingPresenter tag='h1' className='sample' />,
60
+
61
+ rootElement
62
+
63
+ );
64
+
65
+
66
+
67
+ ```
68
+
69
+
70
+
71
+ [https://codesandbox.io/s/qqm1891759](https://codesandbox.io/s/qqm1891759)
72
+
73
+
74
+
75
+ 上記で動作確認した限りでは問題なく、スタイルが適用されました。