MFE header override

Hi Folks! I am trying to install the header component for the Account MFE. I am working with a lilac.2 devstack, the account MFE is also checked out for lilac.2.
I have cloned the header component repository, checked out v2.2.4, ran npm install and npm run build in that repo.
I installed the component in the MFE with
npm install --save @edx/frontend-component-header@file../frontend-component-header
When I start the MFE, it compiles successfully but getting an error in the browser:

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 https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

The brand-openedx and the frontend-component-footer override work just fine, I am only facing issues with the header.

I haven’t made any changes in the header repository yet, just trying to install it as it is for a start.

I am new to react and would really appreciate some help! Thanks!