mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 10:35:56 +01:00 
			
		
		
		
	Enable refetch on focus (#1559)
During the integration of react-query we had to disable the refetch on focus option, because it has cleared our input fields on refocusing the browser tab. This problem comes mostly from a wrong use of routes. Often routes were used with the component prop and a anonymous function e.g.:
```jsx
<Route path="/my/route" component={() => <AwesomeComponent />} />
```
This triggers not only rerendering but remounting of the route component every time the parent is rerendered. With the ongoing work on the migration from redux to react-query, we have removed the usage of routes with component functions. So we can now safely enable the option refetch on mount of react-query.
			
			
This commit is contained in:
		| @@ -22,7 +22,7 @@ | ||||
|  * SOFTWARE. | ||||
|  */ | ||||
| import React from "react"; | ||||
| import { Redirect, Route, Link as RouteLink, Switch, useRouteMatch, match } from "react-router-dom"; | ||||
| import { Redirect, Route, Link as RouteLink, Switch, useRouteMatch } from "react-router-dom"; | ||||
| import { useTranslation } from "react-i18next"; | ||||
| import { binder, ExtensionPoint } from "@scm-manager/ui-extensions"; | ||||
| import { Changeset, Link } from "@scm-manager/ui-types"; | ||||
| @@ -245,7 +245,9 @@ const RepositoryRoot = () => { | ||||
|               <Redirect exact from={`${url}/changesets`} to={`${url}/code/changesets`} /> | ||||
|               <Redirect from={`${url}/branch/:branch/changesets`} to={`${url}/code/branch/:branch/changesets/`} /> | ||||
|  | ||||
|               <Route path={`${url}/info`} exact component={() => <RepositoryDetails repository={repository} />} /> | ||||
|               <Route path={`${url}/info`} exact> | ||||
|                 <RepositoryDetails repository={repository} /> | ||||
|               </Route> | ||||
|               <Route path={`${url}/settings/general`}> | ||||
|                 <EditRepo repository={repository} /> | ||||
|               </Route> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user