Skip to content

Commit 7d64842

Browse files
authored
Revert "perf: Use PureComponent to avoid useless re-renders (#7258)" (#7328)
This reverts commit bfe0d2b.
1 parent fc53733 commit 7d64842

File tree

14 files changed

+15
-15
lines changed

14 files changed

+15
-15
lines changed

packages/react-router-dom/modules/BrowserRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import warning from "tiny-warning";
77
/**
88
* The public API for a <Router> that uses HTML5 history.
99
*/
10-
class BrowserRouter extends React.PureComponent {
10+
class BrowserRouter extends React.Component {
1111
history = createHistory(this.props);
1212

1313
render() {

packages/react-router-dom/modules/HashRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import warning from "tiny-warning";
77
/**
88
* The public API for a <Router> that uses window.location.hash.
99
*/
10-
class HashRouter extends React.PureComponent {
10+
class HashRouter extends React.Component {
1111
history = createHistory(this.props);
1212

1313
render() {

packages/react-router-native/BackButton.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BackHandler } from "react-native";
33

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

6-
class BackButton extends React.PureComponent {
6+
class BackButton extends React.Component {
77
handleBack = () => {
88
if (this.history.index === 0) {
99
return false; // home screen

packages/react-router-native/DeepLinking.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { __HistoryContext as HistoryContext } from "react-router";
55

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

8-
class DeepLinking extends React.PureComponent {
8+
class DeepLinking extends React.Component {
99
push(url) {
1010
const pathname = url.replace(protocolAndSlashes, "");
1111
this.history.push(pathname);

packages/react-router-native/Link.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
44

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

7-
export default class Link extends React.PureComponent {
7+
export default class Link extends React.Component {
88
static defaultProps = {
99
component: TouchableHighlight,
1010
replace: false

packages/react-router-native/experimental/StackRoute.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const PARENT_TRAVEL_DISTANCE = 100;
7676
const PARENT_FINAL_OPACITY = 0.25;
7777
const CARD_SHADOW_RADIUS = 10;
7878

79-
class AnimatedStack extends React.PureComponent {
79+
class AnimatedStack extends React.Component {
8080
static propTypes = {
8181
title: PropTypes.any,
8282
content: PropTypes.any,

packages/react-router-native/experimental/TabRoutes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { View } from "react-native";
44

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

7-
export class TabRoutes extends React.PureComponent {
7+
export class TabRoutes extends React.Component {
88
render() {
99
const { children } = this.props;
1010
return (
@@ -36,7 +36,7 @@ export class TabRoutes extends React.PureComponent {
3636
}
3737
}
3838

39-
export class TabRoute extends React.PureComponent {
39+
export class TabRoute extends React.Component {
4040
render() {
4141
const { renderContent, path } = this.props;
4242
return <Route path={path} render={renderContent} />;

packages/react-router-native/index.android.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Prompt
1111
} from "react-router-native";
1212

13-
class ReactRouterNative extends React.PureComponent {
13+
class ReactRouterNative extends React.Component {
1414
render() {
1515
return (
1616
<NativeRouter>

packages/react-router/modules/Lifecycle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22

3-
class Lifecycle extends React.PureComponent {
3+
class Lifecycle extends React.Component {
44
componentDidMount() {
55
if (this.props.onMount) this.props.onMount.call(this, this);
66
}

packages/react-router/modules/MemoryRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Router from "./Router.js";
88
/**
99
* The public API for a <Router> that stores location in memory.
1010
*/
11-
class MemoryRouter extends React.PureComponent {
11+
class MemoryRouter extends React.Component {
1212
history = createHistory(this.props);
1313

1414
render() {

packages/react-router/modules/Route.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function evalChildrenDev(children, props, path) {
2727
/**
2828
* The public API for matching a single path and rendering.
2929
*/
30-
class Route extends React.PureComponent {
30+
class Route extends React.Component {
3131
render() {
3232
return (
3333
<RouterContext.Consumer>

packages/react-router/modules/Router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import RouterContext from "./RouterContext.js";
88
/**
99
* The public API for putting history on context.
1010
*/
11-
class Router extends React.PureComponent {
11+
class Router extends React.Component {
1212
static computeRootMatch(pathname) {
1313
return { path: "/", url: "/", params: {}, isExact: pathname === "/" };
1414
}

packages/react-router/modules/StaticRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function noop() {}
5050
* location changes in a context object. Useful mainly in testing and
5151
* server-rendering scenarios.
5252
*/
53-
class StaticRouter extends React.PureComponent {
53+
class StaticRouter extends React.Component {
5454
navigateTo(location, action) {
5555
const { basename = "", context = {} } = this.props;
5656
context.action = action;

packages/react-router/modules/Switch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import matchPath from "./matchPath.js";
99
/**
1010
* The public API for rendering the first <Route> that matches.
1111
*/
12-
class Switch extends React.PureComponent {
12+
class Switch extends React.Component {
1313
render() {
1414
return (
1515
<RouterContext.Consumer>

0 commit comments

Comments
 (0)