Skip to content

Commit

Permalink
Revert "perf: Use PureComponent to avoid useless re-renders (#7258)" (#…
Browse files Browse the repository at this point in the history
…7328)

This reverts commit bfe0d2b.
  • Loading branch information
mjackson authored May 11, 2020
1 parent fc53733 commit 7d64842
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/react-router-dom/modules/BrowserRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import warning from "tiny-warning";
/**
* The public API for a <Router> that uses HTML5 history.
*/
class BrowserRouter extends React.PureComponent {
class BrowserRouter extends React.Component {
history = createHistory(this.props);

render() {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dom/modules/HashRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import warning from "tiny-warning";
/**
* The public API for a <Router> that uses window.location.hash.
*/
class HashRouter extends React.PureComponent {
class HashRouter extends React.Component {
history = createHistory(this.props);

render() {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-native/BackButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BackHandler } from "react-native";

import { __HistoryContext as HistoryContext } from "react-router";

class BackButton extends React.PureComponent {
class BackButton extends React.Component {
handleBack = () => {
if (this.history.index === 0) {
return false; // home screen
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-native/DeepLinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { __HistoryContext as HistoryContext } from "react-router";

const protocolAndSlashes = /.*?:\/\//g;

class DeepLinking extends React.PureComponent {
class DeepLinking extends React.Component {
push(url) {
const pathname = url.replace(protocolAndSlashes, "");
this.history.push(pathname);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-native/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from "prop-types";

import { __HistoryContext as HistoryContext } from "react-router";

export default class Link extends React.PureComponent {
export default class Link extends React.Component {
static defaultProps = {
component: TouchableHighlight,
replace: false
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-native/experimental/StackRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const PARENT_TRAVEL_DISTANCE = 100;
const PARENT_FINAL_OPACITY = 0.25;
const CARD_SHADOW_RADIUS = 10;

class AnimatedStack extends React.PureComponent {
class AnimatedStack extends React.Component {
static propTypes = {
title: PropTypes.any,
content: PropTypes.any,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-native/experimental/TabRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { View } from "react-native";

import Link from "../Link.js";

export class TabRoutes extends React.PureComponent {
export class TabRoutes extends React.Component {
render() {
const { children } = this.props;
return (
Expand Down Expand Up @@ -36,7 +36,7 @@ export class TabRoutes extends React.PureComponent {
}
}

export class TabRoute extends React.PureComponent {
export class TabRoute extends React.Component {
render() {
const { renderContent, path } = this.props;
return <Route path={path} render={renderContent} />;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-native/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Prompt
} from "react-router-native";

class ReactRouterNative extends React.PureComponent {
class ReactRouterNative extends React.Component {
render() {
return (
<NativeRouter>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/Lifecycle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

class Lifecycle extends React.PureComponent {
class Lifecycle extends React.Component {
componentDidMount() {
if (this.props.onMount) this.props.onMount.call(this, this);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/MemoryRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Router from "./Router.js";
/**
* The public API for a <Router> that stores location in memory.
*/
class MemoryRouter extends React.PureComponent {
class MemoryRouter extends React.Component {
history = createHistory(this.props);

render() {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/Route.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function evalChildrenDev(children, props, path) {
/**
* The public API for matching a single path and rendering.
*/
class Route extends React.PureComponent {
class Route extends React.Component {
render() {
return (
<RouterContext.Consumer>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import RouterContext from "./RouterContext.js";
/**
* The public API for putting history on context.
*/
class Router extends React.PureComponent {
class Router extends React.Component {
static computeRootMatch(pathname) {
return { path: "/", url: "/", params: {}, isExact: pathname === "/" };
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/StaticRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function noop() {}
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
class StaticRouter extends React.PureComponent {
class StaticRouter extends React.Component {
navigateTo(location, action) {
const { basename = "", context = {} } = this.props;
context.action = action;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/modules/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import matchPath from "./matchPath.js";
/**
* The public API for rendering the first <Route> that matches.
*/
class Switch extends React.PureComponent {
class Switch extends React.Component {
render() {
return (
<RouterContext.Consumer>
Expand Down

0 comments on commit 7d64842

Please sign in to comment.