Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@connect的方式是否不能用呢? #22

Closed
t04041143 opened this issue Jul 26, 2016 · 3 comments
Closed

@connect的方式是否不能用呢? #22

t04041143 opened this issue Jul 26, 2016 · 3 comments

Comments

@t04041143
Copy link

import {connect} from "dva";

@connect(
  state => (state.menu)
)
export default class extends React.Component {
    .....
}
@t04041143
Copy link
Author

可以使用,我调用的位置出错了

@Neyzoter
Copy link

Neyzoter commented Jun 30, 2019

请问具体是什么原因造成无法使用注解?我这边

@connect(mapStateToProps, mapDispatchToProps)
export default class HistoricalAlarmTable extends React.Component{...}

报错——Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.

@Neyzoter
Copy link

请问具体是什么原因造成无法使用注解?我这边

@connect(mapStateToProps, mapDispatchToProps)
export default class HistoricalAlarmTable extends React.Component{...}

报错——Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.

已解决--->

export default @connect(mapStateToProps, mapDispatchToProps) class HistoricalAlarmTable extends React.Component{...}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants