function dectest(target: any) {
target.prototype.name = "isfufeng"
}
@dectest
export default class Home extends React.Component<Props, State> {
constructor(props: any) {
super(props)
}
}
first, I used this to add a name class to it, but there was an error in the compilation time
.Module not found: Error: Can"t resolve "babel-runtime/core-js/reflect/metadata" in "d:\allpro\reactdom\reactM\reactAdmin\src\components\home"
is followed by the connect method of react-redux.
"ComponentClass<Pick<any, never>> & { WrappedComponent: ComponentType<any>; }" "typeof Home"
"Component<Pick<any, never>, ComponentState>" "Home"
"componentDidMount" "Component<Pick<any, never>, ComponentState>" "Home"
added
to .babelrc"plugins": [
"react-hot-loader/babel",
"transform-decorators-legacy",
"transform-runtime",
"transform-class-properties"
],
there are great gods who know how to solve it.