React hooks in react library giving Invalid hook call error

I have created a React library with create-react-library this library is your General component. 



npm install --save test


import React, { Component } from 'react';
import General from 'test';
class Example extends Component {
  render() {
    return <General />;
Just click on General component text and count will be incremented.

I cannot reproduce your issue, just use this test to check your implementation.