From 2ef4d6badb1b477f54f15835a92d4ad6eb923188 Mon Sep 17 00:00:00 2001 From: Bruno Kambere Date: Mon, 1 Jan 2024 23:37:11 +0200 Subject: [PATCH] Refactor Button component props --- src/components/Button.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Button.js b/src/components/Button.js index 35ef522..1dd26f8 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -1,14 +1,18 @@ import React from 'react'; import PropTypes from 'prop-types'; -const Button = ({ content, btnClassName = 'gray-button', clickEvent }) => ( +const Button = ({ content, btnClassName, clickEvent }) => ( ); Button.propTypes = { content: PropTypes.string.isRequired, - btnClassName: PropTypes.string.isRequired, + btnClassName: PropTypes.string, clickEvent: PropTypes.func.isRequired, }; +Button.defaultProps = { + btnClassName: 'gray-button', +}; + export default Button;