Instantly share code, notes, and snippets.

Embed
What would you like to do?
import React from 'react';
import PropTypes from 'prop-types';
const ColorSwatch = (props) => {
let style = {
backgroundColor: props.color,
};
return (
<div style={style}>
<h2>{props.text}</h2>
<p>
Lorem ...
</p>
</div>
);
};
ColorSwatch.PropTypes = {
color: PropTypes.string.isRequired,
text: PropTypes.string.isRequired
};
export default ColorSwatch;
@brodybits

This comment has been minimized.

Show comment
Hide comment
@brodybits

brodybits Feb 23, 2018

Why not use const style = { ... }?

brodybits commented Feb 23, 2018

Why not use const style = { ... }?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment