onClick show walk in record BOOKING ID
onClick={() => show("walk_in", record?.BOOKING_ID)}
onClick={() => {
go({
to: getToPath({
resource: "walk_in"
action: "show",
meta: {
id: 1,
},
}),
});
}}
Hi, When I use useGo it doesn't navigate to the page.
12 Replies
Hi @Batu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
foreign-sapphire•11mo ago
resource: "walk_in"
make sure you are passing resource correctly here, as you passed to <Refine >
component in your entrypoint file. resource names are usually plural.Sorry @Batu, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
adverse-sapphire•11mo ago
onClick={() => show("walk_in", record?.BOOKING_ID)}
I use show and it still works.
{
name: "walk_in",
list: "/frontdesk/walk_in",
show: "/frontdesk/walk_in/show/:id",
meta: {
label: "Walk in",
parent: "frontdesk",
},
},
<Route path="/frontdesk/walk_in">
<Route index element={<WalkInList />} />
<Route path="show/:id" element={<WalkInList />} />
</Route>
Do you consider this correct?
foreign-sapphire•11mo ago
Can you create a reproducible example on stackblitz? We can help you better if you provide us.
adverse-sapphire•11mo ago
I will try to create an example on stackblitz, you can preview the error with useGo.
onClick={() => show("walk_in", record?.BOOKING_ID)}
onClick={() => {
go({
to: getToPath({
resource: "walk_in"
action: "show",
meta: {
id: 1,
},
}),
});
}}
hooks {show} = useNavigation() => it still active
hooks go = useGo() => it inactive
@Batu Can you help me with this problem? When clicking the button, view details of a row in the table, and navigate to another page. And I want to have the data of that row. So how can it be used?
foreign-sapphire•11mo ago
Can you try to use like this?
You can check the docs here: https://refine.dev/docs/api-reference/core/hooks/navigation/useGo/#with-resource
useGo | refine
useGo is a hook that leverages the go method of the routerProvider to perform navigation operations.
adverse-sapphire•11mo ago
Yepp, I have to pass data to other component while using useGo. And I don't want to use query parameter
foreign-sapphire•11mo ago
How do you plan to pass data to another component without query parameters? This is not a refine question.
adverse-sapphire•11mo ago
https://discord.com/channels/837692625737613362/1159227638821433495/1159228328805412945
same as the question here. So we have to use React Context, right?
foreign-sapphire•11mo ago
Yeah
adverse-sapphire•11mo ago
thanks you