You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use swr in my host component, but when I use ModuleFederationPlugin, I get an error “hooks can only be called inside of the body of a function component”. This only happens when I use remotes and not when I use exposes. I leave an example of App with SWR to replicate the error, it is not necessary to add the remote component to the App just add it to the remotes inside rsbuild.config.ts. I am using React, Typescript and Rsbuild.
you most likely forgot to add singletion: true to shared deps configuration of react. Also always add required version for react too, so that runtime has easier time understanding which version should be loaded.
I am trying to use swr in my host component, but when I use ModuleFederationPlugin, I get an error “hooks can only be called inside of the body of a function component”. This only happens when I use remotes and not when I use exposes. I leave an example of App with SWR to replicate the error, it is not necessary to add the remote component to the App just add it to the remotes inside rsbuild.config.ts. I am using React, Typescript and Rsbuild.
The text was updated successfully, but these errors were encountered: