Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning on FileWidget #842

Merged
merged 1 commit into from
Apr 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/components/widgets/FileWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ function extractFileInfo(dataURLs) {
}

class FileWidget extends Component {
defaultProps = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the bottom it shows :


 FileWidget.defaultProps = {
   autofocus: false,
 };

so it seems the defaultprops are not the same, this is strange ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple: false should be added there, since multiple is not a required property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I initially left it out was to do the simplest possible change. When defaultProps is set as an instance property, they are ignored, meaning that if we add multiple: false to the defaultProps, it is small change in the functionality. If the maintainers think we should fix both problems on a single PR, I'm happy to make the change 🙂

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think we should rather fix the other problem later, to not break backwards-compatibility.

multiple: false,
};

constructor(props) {
super(props);
const { value } = props;
Expand Down