Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preferCacheValue couldn't get the types correctly #3072

Closed
bryanltobing opened this issue Jan 10, 2023 · 3 comments
Closed

preferCacheValue couldn't get the types correctly #3072

bryanltobing opened this issue Jan 10, 2023 · 3 comments

Comments

@bryanltobing
Copy link

bryanltobing commented Jan 10, 2023

I have seen this discussion and believe that this has already resolved within the new version of rtk query

but as of my use, i still don't get the types correctly

image

I thought because i'm not using the latest version

but i have upgraded my rtk query to the latest version, also i have updated my typescript to the latest version as well.

and still don't get the types of preferCacheValue correctly in the second argument of the trigger lazyQuery

{
  "@reduxjs/toolkit": "^1.9.1",
  "typescript": "^4.9.4"
}

this is my tsconfig

{
  "extends": "@tsconfig/react-native/tsconfig.json",
  "compilerOptions": {
    "incremental": true,
    "skipLibCheck": true,
    "baseUrl": "./src",
    "paths": {
      "@assets": ["assets"]
    }
  },
  "exclude": ["appium"]
}

Note: The functionality of works though, only the types that doesn't work

@bryanltobing bryanltobing changed the title preferCacheValues couldn't get the types correctly preferCacheValue couldn't get the types correctly Jan 10, 2023
@phryneas
Copy link
Member

You just put true or false in there, not an object.

@bryanltobing
Copy link
Author

do u mean like this ?

getPointHistories({dir: "in"}, true)

@phryneas
Copy link
Member

Yes. TypeScript is very explicit that the second argument should only be boolean and not an object with a boolean inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants