"use client"
import { useSearchParams } from "next/navigation"
import { Fragment } from "react"

// Solution derived from leerobs example
// https://github.com/vercel/next.js/issues/53543#issuecomment-2327883526
// Ensure children are re-rendered when the search query changes
export default function ChildrenWrapper({ children }: React.PropsWithChildren) {
  const searchParams = useSearchParams()
  return <Fragment key={searchParams.toString()}>{children}</Fragment>
}
