Skip to content

Commit 2bef5ff

Browse files
Fix missing null check in layout renderer (#221)
* fixes null exception * docs(changeset): Reintroduces null check in the case where props can't be parsed and return empty
1 parent 51f670f commit 2bef5ff

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/itchy-masks-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pretty-proptypes': patch
3+
---
4+
5+
Reintroduces null check in the case where props can't be parsed and return empty

packages/pretty-proptypes/src/LayoutRenderer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type LayoutRendererProps = {
3535
renderType: CommonProps => ComponentType<CommonProps>
3636
};
3737

38-
const getProps = props => (props && props.component ? getPropTypes(props.component) : null);
38+
const getProps = props => (props && props.component ? getPropTypes(props.component) : []);
3939

4040
const LayoutRenderer: FC<LayoutRendererProps> = ({ props, component, components, ...rest }) => {
4141
let resolvedProps = props;

0 commit comments

Comments
 (0)