rive-react, you should be able to upgrade to the new dependencies in v3.x.x without many changes.
rive-reactpackage. This package was a wrapper around the
@rive-app/webgldependency. In version 2.x.x+, we enable the React runtime to wrap around both the
@rive-app/canvasdependencies through 2 main new React packages:
rive-reactpackage will still be published to regularly along with the above packages, but it has both of the web runtime dependencies set as
dependenciesand may result in a larger bundle. Because of this, we recommend switching from
@rive-app/react-canvasor the WebGL variant if you need to use a WebGL backing context.
RiveComponentwhether you use the default export or the
useRivehook provided. This component should be passed into the JSX to render the canvas out. The DOM encompasses a wrapping div around the canvas that helps to handle the styling and sizing of the canvas. Most props spread on the
RiveComponentwould be spread onto that wrapping
<div>element. Starting in v2.x.x, certain props will be spread onto the wrapping
<div>that concern styling (i.e
style), but any other props will now be spread onto the
<canvas>element, so that you can set
aria-*attributes, etc. Before: