Skip to content

Commit

Permalink
Moved the logic for <HelloWidget> into a new separate file 'webpack_i…
Browse files Browse the repository at this point in the history
…n/hello_widget.jsx'.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent 59750a0 commit 0919b00
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
11 changes: 1 addition & 10 deletions webpack_in/entry.jsx
Expand Up @@ -11,19 +11,10 @@ import React from 'react';
import ReactDOM from 'react-dom';

import ButtonWidget from './button_widget.jsx';
import HelloWidget from './hello_widget.jsx';
import Styles from './styles.es';


class HelloWidget extends React.Component {
render() {
return (
<div style={{ ...Styles.common, ...Styles.content }}>
Hello! I'm a React app!!
</div>
);
}
}

class TextWidget extends React.Component {
constructor(props) {
super(props);
Expand Down
20 changes: 20 additions & 0 deletions webpack_in/hello_widget.jsx
@@ -0,0 +1,20 @@
// This file 'hello_widget.jsx' is part of an example for building a multi-widget React front-end
// app step by step as outlined in the tutorial blog at
// http://maratbn.com/blogs/2018/07/02/react-multi-widget/


import React from 'react';
import Styles from './styles.es';


class HelloWidget extends React.Component {
render() {
return (
<div style={{ ...Styles.common, ...Styles.content }}>
Hello! I'm a React app!!
</div>
);
}
}

export default HelloWidget;

0 comments on commit 0919b00

Please sign in to comment.