rive-app / rive-react

React runtime for Rive

Home Page:https://rive-app.github.io/rive-react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rive component not rendering in NextJS

felipesses opened this issue · comments

Hi, I am using NextJs in my project and my Rive component is not rendering,

I have imported the @rive-app/react-canvas package and I'm using the current version, "^3.0.38"

Here's my folder
Captura de Tela 2023-03-15 às 11 00 08

The component
Captura de Tela 2023-03-15 às 11 00 33

It seems like the canvas is rendering, but it doesn't show anything
Captura de Tela 2023-03-15 às 11 00 48

Hey @felipesses

Your canvas height is being set to 0. Do you know what could be causing that?

Could you share some code so I could reproduce this locally? A link to a github repo I could clone would be ideal.

Hey @felipesses

Your canvas height is being set to 0. Do you know what could be causing that?

Could you share some code so I could reproduce this locally? A link to a github repo I could clone would be ideal.

Hey! I have found the issue. I had to set the height of the component otherwise it renders so small that I couldn't see it 😅 thanks for the reply!

I'm having the same issue. It feels limiting having to set a fixed height to make it work, and it doesn't work if the user resizes the window.