rive-app / rive-react

React runtime for Rive
https://rive-app.github.io/rive-react
MIT License
808 stars 32 forks source link

Rive component not rendering in NextJS #162

Closed felipesses closed 1 year ago

felipesses commented 1 year ago

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

avivian commented 1 year ago

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.

felipesses commented 1 year ago

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!

Klynger commented 1 year ago

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.