-
-
Save gdyrrahitis/88d0069657a7b1ec84f8bf95fadb4339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
export class Greet extends React.Component { | |
constructor(props) { | |
super(); | |
this.props = props; | |
} | |
sayHi(props) { | |
if (!props.value || props.value.length < 3) { | |
return <h4 className="text-danger"> | |
Please enter a name so I can greet you properly! | |
</h4>; | |
} | |
return <h4>{props.value} says hi!</h4>; | |
} | |
render() { | |
const store = this.props.store; | |
const value = store.getState(); | |
return <div className="row"> | |
<div className="col-md-12"> | |
<this.sayHi value={value} /> | |
</div> | |
</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment