fix(netlify-cms-core): fix prop-types warnings (#1906)

This commit is contained in:
Alexander Nanberg 2018-11-26 18:01:02 +01:00 committed by Shawn Erquhart
parent 955f94f72b
commit 751ec091fb
2 changed files with 6 additions and 3 deletions

View File

@ -174,7 +174,6 @@ class EditorToolbar extends React.Component {
isDeleting: PropTypes.bool,
onPersist: PropTypes.func.isRequired,
onPersistAndNew: PropTypes.func.isRequired,
enableSave: PropTypes.bool.isRequired,
showDelete: PropTypes.bool.isRequired,
onDelete: PropTypes.func.isRequired,
onDeleteUnpublishedChanges: PropTypes.func.isRequired,

View File

@ -60,6 +60,10 @@ class MediaLibrary extends React.Component {
t: PropTypes.func.isRequired,
};
static defaultProps = {
files: [],
};
/**
* The currently selected file and query are tracked in component state as
* they do not impact the rest of the application.
@ -120,7 +124,7 @@ class MediaLibrary extends React.Component {
/**
* Filter an array of file data to include only images.
*/
filterImages = (files = []) => {
filterImages = files => {
return files.filter(file => {
const ext = fileExtension(file.name).toLowerCase();
return IMAGE_EXTENSIONS.includes(ext);
@ -277,7 +281,7 @@ class MediaLibrary extends React.Component {
const {
isVisible,
canInsert,
files = [],
files,
dynamicSearch,
dynamicSearchActive,
forImage,