@tremendous/help
    Preparing search index...

    Function useRemoteFile

    • Fetches a file from the given URL and returns it as a File object. Automatically infers the file type. Assumes the last part of the URL is the filename.

      Parameters

      • url: undefined | string

        The URL to fetch the file from.

      Returns undefined | File

      • The fetched file as a File object or undefined if the file could not be fetched.
      // File is `undefined` until the file is fetched or if the request fails
      const file = useRemoteFile("https://example.com/image.png");