How can I do something similar to the below, without manually passing data into the function from a component?
function doSomething()
return (dispatch, getState) => {
console.log(getState().router.match.params)
}
}
The reason this is important is because vital variables are stored in the URL in React (e.g. page for pagination, document ID, search input). When these are stored in Redux, it's super easy to access them and there's no need to pass them through from a component. But it seems like for match.params, this has to be manually passed through potentially several wrapped components into an action.