Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updateImage = (file) => {
- let not_a_valid_image = '';
- var valid = /(\.jpg|\.jpeg|\.png|\.pdf)$/i;
- if(!valid.exec(file.name)){
- not_a_valid_image = 'Please upload a valid image';
- this.props.onError && this.props.onError(not_a_valid_image);
- } else {
- this.setState({err: '',image: file})
- this.props.getImage(file)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement