#How to pass props to a dynamic route?
18 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
if your "props" are static, you can define them in your dynamic component. Else: where does the "dynamic" data that you want to share as props comes from? From a database/cms/... then fetch it @strong ridge
i dont have any identifiers in the dynamic route aside from the name of the route that would allow me to fetch the data though.
so your data is dynamic and you don't have any connection to get the data, that you want to get. Have I understood that right?
yeah so my data is in a database but i have no way of querying the database since i dont have any props like an id or something
all i have is the dynamic segment
ok and you can't get the "prop-data" with your id of your dynamic fragment?
the way that its set up now, no the id is just a string that i cant use to query my db
i could probably change the name of the dynamic segment but i wanted to see if there was a way for me to pass props down
via a link you can only access the stuff inside the string (so parts of the url and searchparams). So currently I don't see any other way.
Imagine a user gets the link and wasn't on your page ever. What does your page know? Only the url stuff
@strong ridge solved?
if (solved) {
await markAsSolution();
} else {
throw new Error("What's missing to solve your question?")?
}
@strong ridge Error while closing thread: What's missing to solve your question?
@strong ridge ?
Solved
great to hear. Please mark a message as solution
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1191765058208940111 message)