Added webpack.ProvidePlugin for most used imports

Removed imports of React, connect, PropTypes throughout
Removed the "React" in React.Component/PureComponent
This commit is contained in:
mgabdev
2019-07-29 15:20:00 -04:00
parent dd6129e218
commit 2044648179
224 changed files with 92 additions and 532 deletions

View File

@@ -1,5 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Redirect, Route } from 'react-router-dom';
import ColumnsAreaContainer from '../containers/columns_area_container';
import ColumnLoading from '../components/column_loading';
@@ -7,7 +5,7 @@ import BundleColumnError from '../components/bundle_column_error';
import BundleContainer from '../containers/bundle_container';
import { me } from 'gabsocial/initial_state';
export class WrappedRoute extends React.Component {
export class WrappedRoute extends Component {
static propTypes = {
component: PropTypes.func.isRequired,
page: PropTypes.func,

View File

@@ -1,8 +1,6 @@
// Like react-motion's Motion, but reduces all animations to cross-fades
// for the benefit of users with motion sickness.
import React from 'react';
import Motion from 'react-motion/lib/Motion';
import PropTypes from 'prop-types';
const stylesToKeep = ['opacity', 'backgroundOpacity'];
@@ -11,7 +9,7 @@ const extractValue = (value) => {
return (typeof value === 'object' && value && 'val' in value) ? value.val : value;
};
class ReducedMotion extends React.Component {
class ReducedMotion extends Component {
static propTypes = {
defaultStyle: PropTypes.object,