Skip to content

Commit 5379c61

Browse files
committed
prevent error when component has no propTypes
1 parent 54d3a7d commit 5379c61

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ function reactDirectives (directives) {
1616
// e.g richInput is valid whereas RichInput is not
1717
name = name.charAt(0).toLowerCase() + name.substr(1);
1818

19-
const props = Object.keys(Component.propTypes);
19+
const props =
20+
Component.hasOwnProperty('propTypes')
21+
? Object.keys(Component.propTypes)
22+
: [];
23+
2024
const bindings = props.reduce(function (result, prop) {
2125
result[prop] = '=';
2226
return result;

0 commit comments

Comments
 (0)