@@ -152,11 +152,9 @@ Use hyperscript `h` and pass a **`sel`** as a prop. Use that selector in `source
152
152
``` js
153
153
import React from " react" ;
154
154
import ReactDOM from " react-dom" ;
155
- import " ./index.css" ;
156
-
157
155
import { makeComponent , h } from " @cycle/react" ;
158
156
159
- // react coponent
157
+ // React component
160
158
function Welcome (props ) {
161
159
return (
162
160
< div>
@@ -168,18 +166,18 @@ function Welcome(props) {
168
166
);
169
167
}
170
168
171
- // cyclejs component
169
+ // Cycle.js component that uses the React component above
172
170
function main (sources ) {
173
171
const click$ = sources .react
174
- .select (" welcomeSel " )
175
- .events (" pressWelcomeButton" )
172
+ .select (' welcome ' )
173
+ .events (' pressWelcomeButton' )
176
174
.debug (' btn' )
177
175
.startWith (null );
178
176
179
177
const vdom$ = click$ .map (click =>
180
- h (" div" , [
181
- h (Welcome, { sel: " welcomeSel " , name: " madame" }),
182
- h (" h3 " , [` button click event stream: ${ click} ` ])
178
+ h (' div' , [
179
+ h (Welcome, { sel: ' welcome ' , name: ' madame' }),
180
+ h (' h3 ' , [` button click event stream: ${ click} ` ])
183
181
])
184
182
);
185
183
@@ -189,8 +187,9 @@ function main(sources) {
189
187
}
190
188
191
189
const Component = makeComponent (main);
192
- ReactDOM .render (< Component / > , document .getElementById (" root" ));
190
+ ReactDOM .render (< Component / > , document .getElementById (' root' ));
193
191
```
192
+
194
193
</p >
195
194
</details >
196
195
0 commit comments