Validate missing prop types

This commit is contained in:
Ariful Alam
2022-03-20 01:36:43 +06:00
parent a2ada305a7
commit ec458191fb
11 changed files with 63 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import { useState, Fragment, useEffect } from 'react';
import PropTypes from 'prop-types';
const LazyImage = ({ placeholder, src, alt, ...rest }) => {
const [loading, setLoading] = useState(true);
@@ -19,4 +20,10 @@ const LazyImage = ({ placeholder, src, alt, ...rest }) => {
);
};
LazyImage.propTypes = {
placeholder: PropTypes.node,
alt: PropTypes.string,
src: PropTypes.string,
};
export default LazyImage;