excise withRouter from function components

This commit is contained in:
John Mitchell
2020-04-08 10:59:09 -04:00
parent e57991d498
commit 6eeb32a447
10 changed files with 37 additions and 44 deletions
@@ -1,13 +1,15 @@
import React, { useState } from 'react';
import { withRouter } from 'react-router-dom';
import { useHistory } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { CardBody } from '@components/Card';
import UserForm from '../shared/UserForm';
import { UsersAPI } from '@api';
function UserEdit({ user, history }) {
function UserEdit({ user }) {
const [formSubmitError, setFormSubmitError] = useState(null);
const history = useHistory();
const handleSubmit = async values => {
setFormSubmitError(null);
try {
@@ -34,4 +36,4 @@ function UserEdit({ user, history }) {
);
}
export default withI18n()(withRouter(UserEdit));
export default withI18n()(UserEdit);