Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-upload

Package Overview
Dependencies
Maintainers
3
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-upload - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

4

HISTORY.md
# History
----
### 1.12.0 2016-05-10
- add supportServerRender prop
### 1.11.0 2016-05-03

@@ -5,0 +9,0 @@

31

lib/Upload.js

@@ -39,3 +39,5 @@ 'use strict';

beforeUpload: _react.PropTypes.func,
withCredentials: _react.PropTypes.bool
onReady: _react.PropTypes.func,
withCredentials: _react.PropTypes.bool,
supportServerRender: _react.PropTypes.bool
},

@@ -50,5 +52,7 @@

onProgress: empty,
onReady: empty,
onStart: empty,
onError: empty,
onSuccess: empty,
supportServerRender: false,
multiple: false,

@@ -67,15 +71,24 @@ beforeUpload: null,

componentDidMount: function componentDidMount() {
/* eslint react/no-did-mount-set-state:0 */
this.setState({
Component: typeof FormData !== 'undefined' ? _AjaxUploader2['default'] : _IframeUploader2['default']
});
if (this.props.supportServerRender) {
/* eslint react/no-did-mount-set-state:0 */
this.setState({
Component: this.getComponent()
}, this.props.onReady);
}
},
getComponent: function getComponent() {
return typeof FormData !== 'undefined' ? _AjaxUploader2['default'] : _IframeUploader2['default'];
},
render: function render() {
var Component = this.state.Component;
if (this.props.supportServerRender) {
var _Component = this.state.Component;
if (Component) {
return _react2['default'].createElement(Component, this.props);
if (_Component) {
return _react2['default'].createElement(_Component, this.props);
}
return null;
}
return null;
var Component = this.getComponent();
return _react2['default'].createElement(Component, this.props);
}

@@ -82,0 +95,0 @@ });

{
"name": "rc-upload",
"version": "1.11.0",
"version": "1.12.0",
"description": "upload ui component for react",

@@ -29,3 +29,3 @@ "keywords": [

"config": {
"port": 8000
"port": 8020
},

@@ -32,0 +32,0 @@ "scripts": {

@@ -57,2 +57,4 @@ # rc-upload

|name | string | file| file param post to server |
|supportServerRender | boolean | false| whether to support server render |
|onReady | function | | only call when supportServerRender is true, upload is rendered completely |
|action| string | | from action url |

@@ -59,0 +61,0 @@ |data| object/function(file) | | other data object to post or a function which returns a data object |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc