Closed lemmingapex closed 6 years ago
Hmm. This can't be done entirely via the urlPropsQueryConfig, but you can add in mapUrlToProps function for this purpose. I think this would work:
function mapUrlToProps(urlProps, props) {
return {
...urlProps, // expand all url props for normal behavior (optional)
urlParams: urlProps // gather all url props into a single object
};
}
This would add a new prop called urlParams
to the props and it would contain the object of all url query params from the config.
To use it, you would do something like:
export default addUrlProps({ mapUrlToProps, urlPropsQueryConfig })(MainPage);
Let me know if this works!
Worked like a charm! Thank you.
This is a great library, thanks. I am wondering what the easiest way to put all the url props in a child object of props might look like. Accessing a urlProp of
name
might look like:rather than
Is it possible to do this entirely via urlPropsQueryConfig?
Thanks in advance!