I created my own UI tool from styled-components library (using typescript and rollup).
For example, I have the following component:
import styled from 'styled-components'
export const MyUITest2 = styled.div`
color: red;
`
So, I use this component in another project:
<MyUITest2>This is my test</MyUITest2>
And, when I run the application, I get:
The above error occurred in the <styled.div> component:
in styled.div (at ...)
...
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See ... react-invalid-hook-call for tips about how to debug and fix this problem.
I think there is a problem with styled-components because when I use a simple without styled-components, my component is displayed on the application.
Here my github repository: https://github.com/aehp20/ionic-react-my-ui-components
Thank you in advance!