connected-react-router icon indicating copy to clipboard operation
connected-react-router copied to clipboard

Function as a parameter

Open janmarsicek opened this issue 5 years ago • 0 comments

Hi everyone 👋

Is there a possibility a function as a parameter for navigation actions (like push or replace) will ever be supported?

push(location => ({ ...location, pathname: '/courses' }));

// or

push(location => `${location.pathname}?sort=name`);

in a similar manner as <Link /> component supports it https://reacttraining.com/react-router/web/api/Link/to-function

Thanks ✌️

janmarsicek avatar Apr 06 '20 08:04 janmarsicek