1import PropTypes from 'prop-types'
2
3const Button = ({ color, text, onClick }) => {
4 return (
5 <button
6 onClick={onClick}
7 style={{backgroundColor: color}}
8 className='btn'>
9 {text}
10 </button>
11 )
12}
13
14Button.defaultrops = {
15 color: 'steelblue'
16}
17
18Button.propTypes = {
19 text: PropTypes.string,
20 color:PropTypes.string,
21 onClick: PropTypes.func,
22}
23
24export default Button