Skip to content

Commit 0919b00

Browse files
committed
Moved the logic for <HelloWidget> into a new separate file 'webpack_in/hello_widget.jsx'.
1 parent 59750a0 commit 0919b00

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

webpack_in/entry.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,10 @@ import React from 'react';
1111
import ReactDOM from 'react-dom';
1212

1313
import ButtonWidget from './button_widget.jsx';
14+
import HelloWidget from './hello_widget.jsx';
1415
import Styles from './styles.es';
1516

1617

17-
class HelloWidget extends React.Component {
18-
render() {
19-
return (
20-
<div style={{ ...Styles.common, ...Styles.content }}>
21-
Hello! I'm a React app!!
22-
</div>
23-
);
24-
}
25-
}
26-
2718
class TextWidget extends React.Component {
2819
constructor(props) {
2920
super(props);

webpack_in/hello_widget.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file 'hello_widget.jsx' is part of an example for building a multi-widget React front-end
2+
// app step by step as outlined in the tutorial blog at
3+
// http://maratbn.com/blogs/2018/07/02/react-multi-widget/
4+
5+
6+
import React from 'react';
7+
import Styles from './styles.es';
8+
9+
10+
class HelloWidget extends React.Component {
11+
render() {
12+
return (
13+
<div style={{ ...Styles.common, ...Styles.content }}>
14+
Hello! I'm a React app!!
15+
</div>
16+
);
17+
}
18+
}
19+
20+
export default HelloWidget;

0 commit comments

Comments
 (0)