Replies: 3 comments
-
maybe I should ask this way. I have 2 search api routes, for the DefaultSearchDialog, and when i change the api parameter for the DefaultSearchDialog, i hope the dialog can "sense the api parameter change" and fetch different api, is this a good design? if not, i appreciate so much if you may suggest a better way to do this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
i changed the design to fixed api and solve the issue. thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yep will add other options to the cache key |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My code as follows. My application will change the search api path according to some condition. I found that when api path changes, DefaultSearchDialog will not fetch new api, instead, it shows the old result from the previous api fetch.
"use client";
import DefaultSearchDialog from "fumadocs-ui/components/dialog/search-default";
export function Mysearchbox = () => {
...
const api = ... // api will change according to different conditions
...
return (
<DefaultSearchDialog
key={api} // hope to remount this component
api={api || "/api/search"}
tags={search_dialog_tags}
defaultTag={search_dialog_tags[0].value}
open={open}
onOpenChange={onOpenChange}
delayMs={1000}
/>
)
}
Beta Was this translation helpful? Give feedback.
All reactions