Skip to content

Loading rive file from URL #58

@moringaman

Description

@moringaman

In my compronent I want to load a rive file by setting src to a URL as outlined in the readme, however I am receiving the Problem loading file; may be corrupt! error.

My Code is as follows and the rive file is i n an S3 bucket which has public read permissions

import React from 'react'
import { useRive } from 'rive-react';

function ChunkySoapBounce() {

  const errorHandle = () => {
    console.log('Could not load the Rive file')
  }

  const { RiveComponent } = useRive({
    src: 'https://chunksysoap-1.s3.eu-west-2.amazonaws.com/animations/chunky_bounce.riv',
    autoplay: true,
    onLoadError: errorHandle()
  });

  return <RiveComponent />;
}


export default ChunkySoapBounce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions