Skip to content

v0.4.0

Compare
Choose a tag to compare
@twisty twisty released this 17 Jun 00:05
· 492 commits to master since this release
  • Added a new <File /> component.
  • onChange wasn't being called by some components. It is now. (Thanks @aphillipo)
  • Fix labels so they are properly associated with their form elements. (Thanks @aphillipo)
  • Tweaked npm package so people can find us on http://react-components.com/

Thanks to everyone that has took the time to file issues and provide feedback.


The <File /> component

The <File /> component wraps an <input type="file" />.

This component is very similar to the other <Input /> components, but instead of returning the input element's value (which contains a fake path for security reasons), it returns a HTML5 FileList as the component's value.

What you do with the returned FileList is completely up to you! See christianalfoni/formsy-react#126 for discussion on a formsy-react best practice for this.

As a guide, you might use FormData.append or FileReader.readAsDataURL and then upload using XMLHttpRequest.