question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for file type

See original GitHub issue

Hey there, i’m running into a problem with a custom file select input component that expects an optional instance of File for the selectedFile: PropTypes.instanceOf(File) prop.

Now i defined a mobx-react-form field with type: 'file' and value: null for it but it still has a default value of '' (empty string), which results in an error because the file picker does not accept strings. How can i set default value to null in this case?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
foxhound87commented, Apr 18, 2017

@DominikGuzei Using null on a simple input with type="file" I get:

Warning: `value` prop on `input` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.

So the default value should be an empty string, and you should set null manually on your custom component.

1reaction
DominikGuzeicommented, Feb 9, 2017

Thanks for the ultra fast fix! works like a charm now 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are the supported file types? - Widen Connect
dv), Flash video (.flv), HDV, h.264, IMX, MPEG (.mpg, .mpeg), MPEG-2, MPEG-4 (.mp4), Material Exchange Format (.mxf), Premier Project (.prprog), ...
Read more >
File types supported - Microsoft Information Protection SDK
File types supported for classification only ; Adobe Portable Document Format: .pdf ; Microsoft Power BI: .pbit, .pbix ; Microsoft Project: .mpp, ....
Read more >
Supported File Types - Box Developer Documentation
Supported File Types · Documents · Text-Based Files · Presentations · Images · Audio Files · Video Files · Flash/Mobile Video Files ·...
Read more >
SUPPORT Files: What It Is and How to Open It
SUPPORT files are typically a type of binary file used by certain software, and many software packages can share a common file extension....
Read more >
Supported File Types - Smartling Help Center
Supported File Types ; Google Docs .docx. 10MB, n/a, See Microsoft Word. ; Google Sheets .xlsx. 10MB, n/a, See Microsoft Excel. ; Google...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found