In this tutorial, I explain how to set up Webpack and Babel to create an npm package with a react component inside.
Also, it demonstrates how to avoid "Hooks can only be called inside the body of a function component" error.
If it doesn't work for you:
#1: Maybe you should re-run `npm start` to make it work.
#2: Open your `package.json` file and change the name to something different than `super-lemon`.
#3: Don't forget to increment the version if you publish again
GitHub repo: [ Ссылка ]
Useful article on how to implement CSS in different ways: [ Ссылка ]
Twitter: [ Ссылка ]
GitHub: [ Ссылка ]
![](https://i.ytimg.com/vi/esyS87NfBOw/maxresdefault.jpg)