- Fix PropTypes warning on EditDocument.js when failing to pass a doc prop.
- Improve 404 handling on EditDocument.js and ViewDocument.js when no doc prop is passed.
This commit is contained in:
parent
7e3116677a
commit
11ba0bafaa
2 changed files with 7 additions and 3 deletions
|
|
@ -13,8 +13,12 @@ const EditDocument = ({ doc, history }) => (doc ? (
|
|||
</div>
|
||||
) : <NotFound />);
|
||||
|
||||
EditDocument.defaultProps = {
|
||||
doc: null,
|
||||
};
|
||||
|
||||
EditDocument.propTypes = {
|
||||
doc: PropTypes.object.isRequired,
|
||||
doc: PropTypes.object,
|
||||
history: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue