Permalink
Browse files

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 Jun 30, 2018
1 parent 07d74e9 commit 89ecb689548b7de4a87530d84357d7653fd64b09
Showing with 5 additions and 1 deletion.
  1. +5 −1 webpack_in/entry.jsx
@@ -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>
);

0 comments on commit 89ecb68

Please sign in to comment.