Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
Add Comment
Please, Sign In to add comment