Skip to content

Commit a698833

Browse files
authored
perf(Menu): change some component to PureComponent
close #77
1 parent a3aa3b0 commit a698833

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/Menu/Item.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { Component } from 'react';
1+
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
33

4-
import Checkbox from 'components/Checkbox';
4+
import Checkbox from 'src/components/Checkbox';
55

66
import { ItemWrap } from './style';
77

8-
class Item extends Component {
8+
class Item extends PureComponent {
99
static propTypes = {
1010
/** item的唯一键 */
1111
itemKey: PropTypes.any,

src/components/Select/Option.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { Component } from 'react';
1+
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
33

44
import { OptionWrap } from './style';
55
import { SelectContext } from './Select';
66

7-
class Option extends Component {
7+
class Option extends PureComponent {
88
static propTypes = {
99
/** 值 */
1010
value: PropTypes.any,

src/components/Select/Select.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class Select extends Component {
173173
}
174174
}
175175
};
176-
renderPopup = theme => {
176+
renderPopup = () => {
177177
const { search, children, onChange, multiple, showSelectAll, value, options } = this.props;
178178
const { searchValue, itemTree } = this.state;
179179
const Options = this.renderOptions(options);

0 commit comments

Comments
 (0)