Skip to content

Commit c066f3b

Browse files
committed
added render prop to placeholder
1 parent 53a28d5 commit c066f3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/placeholder.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export default class Placeholder extends React.Component<Props, State> {
3737
}
3838
render() {
3939
const { Component, componentProps } = this.context.router.getState();
40-
return <Component {...componentProps} />
40+
if (this.props.render) {
41+
return this.props.render({ Component, componentProps });
42+
} else {
43+
return <Component key={componentProps.router.path} {...componentProps} />
44+
}
4145
}
4246
}

0 commit comments

Comments
 (0)