Skip to content

Instantly share code, notes, and snippets.

@AnkurVyas-BTC
Last active March 18, 2018 07:43
Show Gist options
  • Select an option

  • Save AnkurVyas-BTC/f45ffd1027a9bc280378ff7eae7d653d to your computer and use it in GitHub Desktop.

Select an option

Save AnkurVyas-BTC/f45ffd1027a9bc280378ff7eae7d653d to your computer and use it in GitHub Desktop.
Content of Greet User component
// Path : app/javascript/components/GreetUser.js
import React from "react";
import PropTypes from "prop-types";
class GreetUser extends React.Component {
render () {
return (
<div>
<h1>Hello {this.props.name}, </h1>
<h3>Wow! This is your first react component!</h3>
</div>
);
}
}
GreetUser.propTypes = {
name: PropTypes.string
};
export default GreetUser;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment