pmndrs / react-three-next

React Three Fiber, Threejs, Nextjs starter
https://react-three-next.vercel.app/
MIT License
2.52k stars 342 forks source link

Styled Components r3f Next13 unexpected behavior #104

Closed mholovko closed 1 year ago

mholovko commented 2 years ago
image

Unstyled elements after page reload, using styled components template.

RenaudRohlinger commented 2 years ago

Hello!

When using styled-components with nextjs it is necessary to inform the compiler in the next.config.js file.

// uncomment the following snippet if using styled-components
// compiler: {
//   styledComponents: true,
// },

I will let this issue open until I automatized this in the create-r3f-app starter.

RenaudRohlinger commented 1 year ago

https://github.com/utsuboco/create-r3f-app/commit/2a12912b8630a103ab674e74adcf44d6d003c0c3 install the config automatically now 👍