render props.value straight

This commit is contained in:
Cássio Zen 2016-06-06 10:41:55 -03:00
parent 70a3d99ac1
commit 139b86c268

View File

@ -3,16 +3,10 @@ import React from 'react';
export default class ImagePreview extends React.Component { export default class ImagePreview extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.handleImageLoaded = this.handleImageLoaded.bind(this);
}
handleImageLoaded() {
window.URL.revokeObjectURL(this.props.value);
} }
render() { render() {
console.log(this.props)
const { value } = this.props; const { value } = this.props;
return value ? <img src={window.URL.createObjectURL(value)} onLoad={this.handleImageLoaded} /> : null; return value ? <img src={value} /> : null;
} }
} }