File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
- export default class LocaleOptions extends Component {
4
+ export default class LocaleOptions extends PureComponent {
5
5
onChange = ( event ) => {
6
6
let { value : locale } = event . target ;
7
7
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
4
const allViews = [ 'hour' , 'minute' , 'second' ] ;
5
5
6
- export default class MaxDetailOptions extends Component {
6
+ export default class MaxDetailOptions extends PureComponent {
7
7
onChange = ( event ) => {
8
8
const { value } = event . target ;
9
9
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import DateTimePicker from 'react-datetime-picker/src/entry' ;
3
3
4
4
import ValidityOptions from './ValidityOptions' ;
@@ -11,7 +11,7 @@ import './Test.less';
11
11
12
12
const now = new Date ( ) ;
13
13
14
- export default class Test extends Component {
14
+ export default class Test extends PureComponent {
15
15
state = {
16
16
locale : null ,
17
17
maxDate : null ,
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
4
import { getISOLocalDateTime } from '../src/shared/dates' ;
5
5
6
- export default class ValidityOptions extends Component {
6
+ export default class ValidityOptions extends PureComponent {
7
7
onMinChange = ( event ) => {
8
8
const { value } = event . target ;
9
9
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
4
import { getISOLocalDateTime } from '../src/shared/dates' ;
5
5
6
- export default class ValueOptions extends Component {
7
- setValue = value => this . props . setState ( { value } ) ;
8
-
6
+ export default class ValueOptions extends PureComponent {
9
7
onChange = ( event ) => {
10
8
const { value } = event . target ;
11
9
12
10
this . setValue ( value ? new Date ( value ) : value ) ;
13
11
}
14
12
13
+ setValue = value => this . props . setState ( { value } ) ;
14
+
15
15
render ( ) {
16
16
const { value } = this . props ;
17
17
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { PureComponent } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
4
- export default class ViewOptions extends Component {
4
+ export default class ViewOptions extends PureComponent {
5
5
onShowLeadingZerosChange = ( event ) => {
6
6
const { checked } = event . target ;
7
7
You can’t perform that action at this time.
0 commit comments