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

@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { changeValue, submit, reset } from '../../../actions/group_editor';
@@ -31,12 +32,9 @@ const mapDispatchToProps = dispatch => ({
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
@withRouter
class Create extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
}
static propTypes = {
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
@@ -48,6 +46,7 @@ class Create extends React.PureComponent {
reset: PropTypes.func.isRequired,
onDescriptionChange: PropTypes.func.isRequired,
onCoverImageChange: PropTypes.func.isRequired,
history: PropTypes.object,
};
constructor(props) {
@@ -69,7 +68,7 @@ class Create extends React.PureComponent {
handleSubmit = e => {
e.preventDefault();
this.props.onSubmit(this.context.router.history);
this.props.onSubmit(this.props.history);
}
render() {