parent
7bbddcaebf
commit
c1c316b379
|
@ -9,13 +9,13 @@ class KeyedDocument extends React.Component<*> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { match } = this.props;
|
||||
const { documentSlug } = this.props.match.params;
|
||||
|
||||
// the urlId portion of the url does not include the slugified title
|
||||
// we only want to force a re-mount of the document component when the
|
||||
// document changes, not when the title does so only this portion is used
|
||||
// for the key.
|
||||
const urlId = match.params.documentSlug.split('-')[1];
|
||||
const urlId = documentSlug ? documentSlug.split('-')[1] : undefined;
|
||||
|
||||
return <DataLoader key={urlId} {...this.props} />;
|
||||
}
|
||||
|
|
Reference in New Issue