Skip to content

Commit 22ca02c

Browse files
committed
fix: 修复 React 警告
When calling super() in (%s), make sure to pass up the same props that your component's constructor was passed.
1 parent ffd80b1 commit 22ca02c

File tree

38 files changed

+76
-76
lines changed

38 files changed

+76
-76
lines changed

src/pages/action/action-sheet/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default class ActionSheetPage extends React.Component<
2020
navigationBarTitleText: 'Taro UI'
2121
}
2222

23-
public constructor() {
24-
super(arguments)
23+
public constructor(props: any) {
24+
super(props)
2525
this.state = {
2626
isOpened1: false,
2727
isOpened2: false,

src/pages/action/activity-indicator/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default class ActivityIndicatorPage extends React.Component<
1717
navigationBarTitleText: 'Taro UI'
1818
}
1919

20-
public constructor() {
21-
super(arguments)
20+
public constructor(props: any) {
21+
super(props)
2222
this.state = {
2323
isOpened: true
2424
}

src/pages/action/modal/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default class ModalPage extends React.Component<{}, ModalPageState> {
2222
navigationBarTitleText: 'Taro UI'
2323
}
2424

25-
public constructor() {
26-
super(arguments)
25+
public constructor(props: any) {
26+
super(props)
2727
this.state = {
2828
isOpened1: false,
2929
isOpened2: false,

src/pages/action/progress/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default class ProgressPage extends React.Component<
1919
navigationBarTitleText: 'Taro UI'
2020
}
2121

22-
public constructor() {
23-
super(arguments)
22+
public constructor(props: any) {
23+
super(props)
2424
this.state = {
2525
percent: 0
2626
}

src/pages/action/swipe-action/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export default class SwipeActionPage extends React.Component<
4141
navigationBarTitleText: 'Taro UI'
4242
}
4343

44-
public constructor() {
45-
super(arguments)
44+
public constructor(props: any) {
45+
super(props)
4646
this.state = {
4747
isOpened2: false,
4848
list: [

src/pages/action/toast/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default class ToastPage extends React.Component<{}, ToastPageState> {
2929
navigationBarTitleText: 'Taro UI'
3030
}
3131

32-
public constructor() {
33-
super(arguments)
32+
public constructor(props: any) {
33+
super(props)
3434
this.state = INIT_STATE
3535
}
3636

src/pages/advanced/calendar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default class Index extends React.Component<{}, IndexState> {
2626
navigationBarTitleText: 'Taro日历组件展示'
2727
}
2828

29-
public constructor() {
30-
super(arguments)
29+
public constructor(props: any) {
30+
super(props)
3131
this.state = {
3232
now: Date.now(),
3333
minDate: '2018/06/11',

src/pages/basic/button/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export default class ButtonPage extends React.Component<{}, ButtonPageState> {
1616
navigationBarTitleText: 'Taro UI'
1717
}
1818

19-
public constructor() {
20-
super(arguments)
19+
public constructor(props: any) {
20+
super(props)
2121
this.state = {
2222
isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP,
2323
isALIPAY: Taro.getEnv() === Taro.ENV_TYPE.ALIPAY

src/pages/basic/color/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default class BasicColor extends React.Component<{}, BasicColorState> {
2323
navigationBarTitleText: 'Taro UI'
2424
}
2525

26-
public constructor() {
27-
super(arguments)
26+
public constructor(props: any) {
27+
super(props)
2828

2929
this.state = {
3030
colorData: [

src/pages/basic/icon/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default class IconPage extends React.Component<{}, IconPageState> {
2727
navigationBarTitleText: 'Taro UI'
2828
}
2929

30-
public constructor() {
31-
super(arguments)
30+
public constructor(props: any) {
31+
super(props)
3232
this.state = {
3333
icons: ICONS
3434
}

0 commit comments

Comments
 (0)