Skip to content

Commit

Permalink
fix: react16 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed May 27, 2017
1 parent 59d1ac5 commit cbd7c7d
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 13 deletions.
3 changes: 2 additions & 1 deletion examples/multi-picker.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import MultiPicker from '../src/MultiPicker';
import React from 'react';
import { View } from 'react-native';
import createReactClass from 'create-react-class';

const cols = [
{
Expand Down Expand Up @@ -36,7 +37,7 @@ const cols = [
},
];

const Test = React.createClass({
const Test = createReactClass({
getInitialState() {
return {
value: ['1', '2'],
Expand Down
3 changes: 2 additions & 1 deletion examples/multi-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'rmc-picker/assets/index.less';
import MultiPicker from '../src/MultiPicker';
import React from 'react';
import ReactDOM from 'react-dom';
import createReactClass from 'create-react-class';

const cols = [
{
Expand Down Expand Up @@ -38,7 +39,7 @@ const cols = [
},
];

const Test = React.createClass({
const Test = createReactClass({
getInitialState() {
return {
value: ['1', '2'],
Expand Down
3 changes: 2 additions & 1 deletion examples/picker.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { View, TouchableHighlight, StyleSheet, Text } from 'react-native';
import Picker from '../src/Picker';
import React from 'react';
import createReactClass from 'create-react-class';

let count = 0;
const len = 10;
Expand All @@ -16,7 +17,7 @@ const styles = StyleSheet.create({
},
});

const PickerDemo = React.createClass({
const PickerDemo = createReactClass({
getInitialState() {
return {
items: this.getItems(count),
Expand Down
3 changes: 2 additions & 1 deletion examples/picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import 'rmc-picker/assets/index.less';
import Picker from '../src/Picker';
import React from 'react';
import ReactDOM from 'react-dom';
import createReactClass from 'create-react-class';

let count = 0;
const len = 10;

const Test = React.createClass({
const Test = createReactClass({
getInitialState() {
return {
disabled: false,
Expand Down
3 changes: 2 additions & 1 deletion examples/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import 'rmc-picker/assets/index.less';
import 'rmc-picker/assets/popup.less';
import React from 'react';
import ReactDOM from 'react-dom';
import createReactClass from 'create-react-class';
// import Picker from '../src/Picker';
import MultiPicker from '../src/MultiPicker';

import Popup from '../src/Popup';

const colData = [{ label: '1', value: '1' }, { label: '2', value: '2' }];

const Demo = React.createClass({
const Demo = createReactClass({
getInitialState() {
return {
disabled: false,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"dependencies": {
"babel-runtime": "6.x",
"classnames": "2.x",
"create-react-class": "^15.5.3",
"object-assign": "4.x",
"rc-dialog": "^6.4.0",
"rc-touchable": "^1.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/MultiPicker.native.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import createReactClass from 'create-react-class';
import Picker from './Picker';
import MultiPickerProps from './MultiPickerProps';
import MultiPickerMixin from './MultiPickerMixin';
Expand All @@ -16,7 +17,7 @@ const styles = StyleSheet.create({
},
});

const MultiPicker = React.createClass<MultiPickerProps, any>({
const MultiPicker = createReactClass<MultiPickerProps, any>({
mixins: [MultiPickerMixin],

render() {
Expand Down
3 changes: 2 additions & 1 deletion src/MultiPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import classnames from 'classnames';
import createReactClass from 'create-react-class';
import Picker from './Picker';
import MultiPickerProps from './MultiPickerProps';
import MultiPickerMixin from './MultiPickerMixin';

const MultiPicker = React.createClass<MultiPickerProps, any>({
const MultiPicker = createReactClass<MultiPickerProps, any>({
mixins: [MultiPickerMixin],

render() {
Expand Down
3 changes: 2 additions & 1 deletion src/NativePicker.android.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { ScrollView, View, StyleSheet, PixelRatio, Text } from 'react-native';
import createReactClass from 'create-react-class';
import PickerMixin from './PickerMixin';
import { IPickerProps } from './PickerTypes';

Expand Down Expand Up @@ -31,7 +32,7 @@ const styles = StyleSheet.create({
} as any,
});

const Picker = React.createClass<IPickerProps, any>({
const Picker = createReactClass<IPickerProps, any>({
mixins: [PickerMixin],

getDefaultProps() {
Expand Down
3 changes: 2 additions & 1 deletion src/Picker.native.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import createReactClass from 'create-react-class';
import NativePicker from './NativePicker';
import { IPickerProps } from './PickerTypes';
import isChildrenEqual from './isChildrenEqual';

const Item = (NativePicker as any).Item;

const Picker = React.createClass<IPickerProps, {}>({
const Picker = createReactClass<IPickerProps, {}>({
getDefaultProps() {
return {
pure: true,
Expand Down
3 changes: 2 additions & 1 deletion src/Picker.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import createReactClass from 'create-react-class';
import classNames from 'classnames';
import ZScroller from 'zscroller';
import { IPickerProps } from './PickerTypes';
import PickerMixin from './PickerMixin';
import isChildrenEqual from './isChildrenEqual';

const Picker = React.createClass<IPickerProps, any>({
const Picker = createReactClass<IPickerProps, any>({
mixins: [PickerMixin],

getDefaultProps() {
Expand Down
5 changes: 3 additions & 2 deletions src/Popup.native.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import {
View, TouchableHighlight, Text,
} from 'react-native';
import React from 'react';
import createReactClass from 'create-react-class';
import { IPopupPickerProps } from './PopupPickerTypes';
import PopupMixin from './PopupMixin';
import Modal from 'rc-dialog/lib/Modal';

const PopupPicker = React.createClass<IPopupPickerProps, any>({
const PopupPicker = createReactClass<IPopupPickerProps, any>({
mixins: [PopupMixin],

getDefaultProps() {
Expand Down
3 changes: 2 additions & 1 deletion src/Popup.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import Modal from 'rc-dialog';
import createReactClass from 'create-react-class';
import { IPopupPickerProps } from './PopupPickerTypes';
import PopupMixin from './PopupMixin';
import Touchable from 'rc-touchable';

const PopupPicker = React.createClass<IPopupPickerProps, any>({
const PopupPicker = createReactClass<IPopupPickerProps, any>({
mixins: [PopupMixin],

getDefaultProps() {
Expand Down

1 comment on commit cbd7c7d

@paranoidjk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.