This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from "react" | |
/** | |
* Takes a file from the file browser and | |
* converts into a base64 string | |
* Shows an alert when the file type does not match | |
* Function is outside so it can be portable | |
* @param {Blob} file | |
* @returns {Promise} | |
*/ |