create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

No support for High order components

Open ShreyKumar opened this issue 5 years ago • 0 comments
trafficstars

I am writing a React package which is an HOC:

const HOC = () => {
     return class extends Component {
            constructor(props) {
                 super(props)
                 this.state = {test: false}
            }
           componentDidMount = async () => {
                 this.setState({test: true}) // this line throws an error when it is not supposed to
           }
          // more stuff
    }
}  

The above works fine on a create-react-app project but not on create-react-library

ShreyKumar avatar Jul 12 '20 20:07 ShreyKumar