vikejs / vike-react

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

fix: export getHeadHtml getPageHtml from vike-react #132

Closed shahyar closed 1 month ago

shahyar commented 1 month ago

In the event someone wants to create their own onRenderHtml HTML output, but still wants to take advantage of the other features vike-react provides, we should export getHeadHtml and getPageHtml.

Although, maybe the best way to do this is to have yet another hook which returns the HTML.

brillout commented 1 month ago

It's best if extensions are all-or-nothing, for many reasons.

Maybe we can make vike-react more configurable to fit your use case. What is it you're trying to achieve?

shahyar commented 1 month ago

Fair enough! I was hoping to control the output of the base HTML in this case. Such as changing attributes on the and tags. But I can do without it by adding another element into the body, I suppose.

I add tailwind classes, and also data attributes during navigation.

brillout commented 1 month ago

The plan is to add settings to vike-react to accommodate your needs.

Would bodyAttributes: Record<string, string> and htmlAttributes: Record<string, string> work for you?

shahyar commented 1 month ago

That works!

brillout commented 1 week ago

Would bodyAttributes: Record<string, string> and htmlAttributes: Record<string, string> work for you?

Done.