Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2018
What would you like to do?
import React from "react";
import ReactDOM from "react-dom";
export class Greet extends React.Component {
constructor(props) {
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!
return <h4>{props.value} says hi!</h4>;
render() {
const store =;
const value = store.getState();
return <div className="row">
<div className="col-md-12">
<this.sayHi value={value} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment