Skip to content

Commit 05a6860

Browse files
author
Salem
authored
Added PropTypes
Added type-checking for the props passed to the component.
1 parent 9ce6741 commit 05a6860

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
class GoogleFontLoader extends React.PureComponent {
45
link = null;
@@ -48,4 +49,13 @@ class GoogleFontLoader extends React.PureComponent {
4849
render = () => null;
4950
};
5051

52+
GoogleFontLoader.propTypes = {
53+
fonts: PropTypes.arrayOf(
54+
PropTypes.shape({
55+
font: PropTypes.string,
56+
weights: PropTypes.arrayOf(PropTypes.number),
57+
}),
58+
),
59+
};
60+
5161
export default GoogleFontLoader;

0 commit comments

Comments
 (0)