Use React Router hook for 'history'

This commit is contained in:
Justin
2022-03-22 08:42:26 -04:00
parent 12ed6889a4
commit 40cc960985
12 changed files with 54 additions and 89 deletions

View File

@ -1,9 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import InlineSVG from 'react-inlinesvg';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import { useDispatch } from 'react-redux';
import { Link, withRouter } from 'react-router-dom';
import { Link, useHistory } from 'react-router-dom';
import { changeSettingImmediate } from 'soapbox/actions/settings';
import snackbar from 'soapbox/actions/snackbar';
@ -16,9 +15,10 @@ const messages = defineMessages({
leave: { id: 'developers.leave', defaultMessage: 'You have left developers' },
});
const Developers = ({ history }) => {
const intl = useIntl();
const Developers = () => {
const dispatch = useDispatch();
const history = useHistory();
const intl = useIntl();
const leaveDevelopers = (e) => {
e.preventDefault();
@ -67,8 +67,4 @@ const Developers = ({ history }) => {
);
};
Developers.propTypes = {
history: PropTypes.object,
};
export default withRouter(Developers);
export default Developers;