From 72b91899b3f5164ce1843ff5187c02ba3b417c20 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 16 Feb 2021 12:04:00 +0100 Subject: [PATCH] feature(components): prop-type Checkbox --- components/common/Checkbox.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/components/common/Checkbox.js b/components/common/Checkbox.js index 1a66a258..67eea80d 100644 --- a/components/common/Checkbox.js +++ b/components/common/Checkbox.js @@ -1,9 +1,10 @@ import React, { useRef } from 'react'; +import PropTypes from 'prop-types'; import Icon from 'components/common/Icon'; import Check from 'assets/check.svg'; import styles from './Checkbox.module.css'; -export default function Checkbox({ name, value, label, onChange }) { +function Checkbox({ name, value, label, onChange }) { const ref = useRef(); return ( @@ -25,3 +26,12 @@ export default function Checkbox({ name, value, label, onChange }) { ); } + +Checkbox.propTypes = { + name: PropTypes.string, + value: PropTypes.any, + label: PropTypes.node, + onChange: PropTypes.func, +}; + +export default Checkbox;