-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I pass component data to breadcrumb? #6
Comments
I am sorry to tell you, the const Breadcrumbs = BreadcrumbConfig({
dynamicRoutesMap: {
'/:id': ({ id }) => {
return new Promise((resolve, reject)=>{
fetch(`http://url.get.name.by/${id}`).then((response)=>{
resolve(response.json().name)
}, ()=>{
// catch some error
})
})
}
},
}); What do you think? |
Thanks for the quick response. I also thought about the same solution but in that case, I need to make two different calls to fetch same information in the dynamicRoutingMap and in my component as well. Which makes me seek :( |
This is a problem, I have not thought of any good solution for data interaction between |
I am not using any state management tool for my react application like redux/Mobx. Just controlling react component state using the plain setState method. |
Here is the use case:
Let's consider person module i.e person = { id : 0, name : 'John Snow' }
I want person name on the breadcrumb link instead of id text.
This can be achieved if I pass directly person name as part of URL but I do not want to do that. (Due to some real-life scenario;s )
For more understanding see the below code :
Real life scenario: I have one module that is
X-Ray Device
which has attributes: device_id and IP address.So over here I want to show IP address on the breadcrumbs link but I do not want to pass IP address as part of URL which kind of weird if pass.
Thanks!
The text was updated successfully, but these errors were encountered: