daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Feb 15th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. validateImageWeight = imageFile => {
  2.     if (imageFile && imageFile.size) {
  3.       // Get image size in kilobytes
  4.       const imageFileKb = imageFile.size / 1024;
  5.       const { maxWeight } = this.props;
  6.       if (imageFileKb > maxWeight) {
  7.         return `Image size must be less or equal to ${maxWeight}kb`;
  8.       }
  9.     }
  10.   };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top