Created
August 17, 2017 08:17
-
-
Save mrcthms/609145abff73a9fb6f6429c926b45df4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
export const oneOfProps = { | |
colour: ['red', 'green', 'blue'], | |
size: ['small', 'medium', 'large'] | |
}; | |
export const propTypes = { | |
name: PropTypes.string.isRequired, | |
colour: PropTypes.oneOf(oneOfProps[colour]).isRequired, | |
size: PropTypes.oneOf(oneOfProps[size]) | |
}; | |
export const Component = () => <div>Hello World</div>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment