vikejs / vike-react

🔨 React integration for Vike
https://vike.dev/vike-react
MIT License
94 stars 15 forks source link

add clientOnly #127

Closed nitedani closed 2 months ago

brillout commented 2 months ago

:rocket: Niceee.

The ref forwarding is only relevant if the loaded component accepts a ref, so I wonder maybe we can return the type as if forwardRef() wouldn't exist, simplifying the whole TS gymnastics.

I think we should update the example ah, actually there isn't any. Maybe we should add a /clientOnly page to examples/full, would be nice also for us to have something to play with.

To keep things consistent, let's export it as import { clientOnly } from vike-react/clientOnly instead of import { clientOnly } from vike-react/ClientOnly (lower-case clientOnly).

nitedani commented 2 months ago

You're right, fixed.

brillout commented 2 months ago

Neat. Let me know when it's ready for review.

nitedani commented 2 months ago

Ready

brillout commented 2 months ago

LGTM. Feel free to merge & release.

brillout commented 2 months ago

I sent you an invitation to be a co-owner of the vike-react package. Btw. we should update the docs: