Skip to content

Instantly share code, notes, and snippets.



Last active Feb 23, 2018
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}>
Lorem ...
ColorSwatch.PropTypes = {
color: PropTypes.string.isRequired,
text: PropTypes.string.isRequired
export default ColorSwatch;

This comment has been minimized.

Copy link

@brodybits 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
You can’t perform that action at this time.