Upgrade react-router-dom to v5.3

This commit is contained in:
Alex Gleason
2022-03-17 20:17:28 -05:00
parent 96398a61f5
commit 1f0341aa2b
53 changed files with 269 additions and 372 deletions

View File

@@ -4,6 +4,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import MissingIndicator from 'soapbox/components/missing_indicator';
@@ -37,12 +38,9 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
@withRouter
class Edit extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
}
static propTypes = {
group: ImmutablePropTypes.map,
title: PropTypes.string.isRequired,
@@ -55,6 +53,7 @@ class Edit extends React.PureComponent {
onDescriptionChange: PropTypes.func.isRequired,
onCoverImageChange: PropTypes.func.isRequired,
setUp: PropTypes.func.isRequired,
history: PropTypes.object,
};
constructor(props) {
@@ -82,11 +81,11 @@ class Edit extends React.PureComponent {
handleSubmit = e => {
e.preventDefault();
this.props.onSubmit(this.context.router.history);
this.props.onSubmit(this.props.history);
}
handleClick = () => {
this.props.onSubmit(this.context.router.history);
this.props.onSubmit(this.props.history);
}
render() {