Redirecting doesn’t work after fetch post method with react

I am trying to redirect to root path / after data is successfully posted to an api (with status 200), so I write as following

// post method fetch

.. then(res => {
     if (res.status === 200) {
         return (
                pathname: "/",

But this doesn’t do any redirect and doesn’t show any error, Am I putting Redirect in wrong position or What am I missing here ?

Source: React Router Questions