Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactored <TextWidget> to render the text to display from its state …
…field 'text', and initialized that field to the same text as rendered previously.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent 07d74e9 commit 89ecb68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webpack_in/entry.jsx
Expand Up @@ -47,12 +47,16 @@ class HelloWidget extends React.Component {
class TextWidget extends React.Component {
constructor(props) {
super(props);

this.state = {
text: "Some text here...."
};
}

render() {
return (
<div style={ objStyleCommon }>
<div style={ objStyleContent }>Some text here....</div>
<div style={ objStyleContent }>{ this.state.text }</div>
<ButtonWidget caption="Change text..." />
</div>
);
Expand Down

0 comments on commit 89ecb68

Please sign in to comment.