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
Hi! So this is a bit of a weird issue, and I am not enough of a typescript wiz to figure it out.
I will do my best to try to explain the issue, but basically I have a monorepo with the redux store as its own package. When importing the package to "my app" and looking at the type of my exported api, made with createApi from @reduxjs/toolkit/query/react it returns as any. Trying the same thing with @reduxjs/toolkit/query works as expected.
As a workaround, I found that exporting with a new object seems to yield the correct type inference export const workaroundReactApi = { ...reactApi };. Feels a bit hacky to do it this way.
Hi! So this is a bit of a weird issue, and I am not enough of a typescript wiz to figure it out.
I will do my best to try to explain the issue, but basically I have a monorepo with the redux store as its own package. When importing the package to "my app" and looking at the type of my exported api, made with
createApi
from@reduxjs/toolkit/query/react
it returns asany
. Trying the same thing with@reduxjs/toolkit/query
works as expected.I have set up a small repo to illustrate the problem. https://codeberg.org/SamuelTilly/redux-ts-issue/src/branch/main
The text was updated successfully, but these errors were encountered: