Skip to content

Instantly share code, notes, and snippets.

@wsrast
Created November 16, 2018 17:27
Show Gist options
  • Save wsrast/1bcafa34fe084c9cf8d040a0be0fd913 to your computer and use it in GitHub Desktop.
Save wsrast/1bcafa34fe084c9cf8d040a0be0fd913 to your computer and use it in GitHub Desktop.
Simple React functional component (super meaty)
import React from 'react';
import PropTypes from 'prop-types';
const Functional3 = props => {
return (
<div>
Hello from Functional3 and {props.name}!
</div>
)
};
Functional3.defaultProps = {
name: '(Forgot the name)'
};
Functional3.propTypes = {
name: PropTypes.string
};
export default Functional3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment