render props.value straight
This commit is contained in:
parent
70a3d99ac1
commit
139b86c268
@ -3,16 +3,10 @@ import React from 'react';
|
||||
export default class ImagePreview extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.handleImageLoaded = this.handleImageLoaded.bind(this);
|
||||
}
|
||||
|
||||
handleImageLoaded() {
|
||||
window.URL.revokeObjectURL(this.props.value);
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log(this.props)
|
||||
const { value } = this.props;
|
||||
return value ? <img src={window.URL.createObjectURL(value)} onLoad={this.handleImageLoaded} /> : null;
|
||||
return value ? <img src={value} /> : null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user