Daydreamer-riri / vite-react-ssg

Static-site generation for React on Vite.
https://vite-react-ssg.netlify.app/
MIT License
125 stars 6 forks source link

Any news about @tanstack/router ? 😇 #25

Closed stouch closed 3 weeks ago

stouch commented 2 months ago

How are we supposed to use your lib when we got a Tanstack Router ?

import { RouterProvider, createRouter } from '@tanstack/react-router'
import { routeTree } from './route-tree.gen.ts'
import { ViteReactSSG } from 'vite-react-ssg'
// ...

// Set up a Router instance
export const tanstackRouter = createRouter({
  routeTree
})

// Register things for typesafety
declare module '@tanstack/react-router' {
  interface Register {
    router: typeof tanstackRouter
  }
}

const rootElement = document.getElementById('app')!
if (!rootElement.innerHTML) {
  const root = ReactDOM.createRoot(rootElement)
  root.render(<RouterProvider router={tanstackRouter} />)
}

// What could we do to use `ViteReactSSG` instead ?
Daydreamer-riri commented 2 months ago

I've been a little busy at work lately, which has caused me to be a little slow on this project. I'll be implementing it as soon as I can though!

ilarramendi commented 2 months ago

+1 to this

Daydreamer-riri commented 3 weeks ago

Hi @stouch @ilarramendi, Tanstack Router is supported in version 0.8.0. Example usage: https://github.com/Daydreamer-riri/vite-react-ssg/blob/main/examples/tanstack/src/main.tsx. It's still experimental, and I would greatly appreciate it if you could try it out and report any issues you encounter.

ilarramendi commented 3 weeks ago

Thanks @Daydreamer-riri, ill be testing this the following days!