From de18b03803c10c291ccd953c4086ec59bc8b0174 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 16 Feb 2021 13:28:32 +0100 Subject: [PATCH] feature(components): prop-type Modal --- components/common/Modal.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/common/Modal.js b/components/common/Modal.js index 42df57e2..694fba60 100644 --- a/components/common/Modal.js +++ b/components/common/Modal.js @@ -1,9 +1,10 @@ import React from 'react'; +import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import { useSpring, animated } from 'react-spring'; import styles from './Modal.module.css'; -export default function Modal({ title, children }) { +function Modal({ title, children }) { const props = useSpring({ opacity: 1, from: { opacity: 0 } }); return ReactDOM.createPortal( @@ -16,3 +17,10 @@ export default function Modal({ title, children }) { document.getElementById('__modals'), ); } + +Modal.propTypes = { + title: PropTypes.node, + children: PropTypes.node, +}; + +export default Modal;