Add examples for using rive-react

This commit is contained in:
Arthur Vivian
2021-06-04 19:42:06 +01:00
parent 3b1d7593fe
commit 6b27b95541
31 changed files with 553 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { useRive } from "rive-react";
function App() {
const params = {
src: "poison-loader.riv",
autoplay: true,
};
const { RiveComponent } = useRive(params);
return (
// The animation will fit to the parent element.
<div style={{ height: "500px", width: "500px" }}>
<RiveComponent />
</div>
);
}
export default App;

View File

@@ -0,0 +1,10 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);