Skip to content

.riv url is re-fetched many times #205

@hckhanh

Description

@hckhanh

When ever I reuse the component that load the .riv file it's still re-fetched the riv file again no matter how many time it is fetched before. Is there any caching mechanism to deal with it? I am using vite and import it as an url

import animationSaladin from '@/assets/animations/file.riv?url'
import { useColorScheme } from '@/states/theme'
import Rive from '@rive-app/react-canvas'
import { memo } from 'react'

const styles = { width: 150, height: 150 }

function LoadingOverlayLoader() {
  const colorScheme = useColorScheme()
  return (
    <Rive
      artboard='Logo'
      src={animationSaladin}
      stateMachines={colorScheme}
      style={styles}
    />
  )
}

export default memo(LoadingOverlayLoader)

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