我有两个Reaction类组件:
Class A个
import React from 'react';
import { withRouter } from 'react-router-dom';
export class A extends React.Component {
}
export default withRouter(A);
Class B
import React from 'react';
import { withRouter } from 'react-router-dom';
import A from './A';
export class B extends A {
}
export default withRouter(B);
When i render class B, i get 'Class constructor cannot be invoked without 'new'' error. When i remove in Class A个(parent of Class B) withRouter
wrapper - all becomes fine. Why does this happen and what should i do to use exact this structure? Babel version/config? Router version? Anything else? Thank you.