[go: up one dir, main page]

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

[Typescript] Faulty types #972

Open
darklight9811 opened this issue May 29, 2022 · 2 comments
Open

[Typescript] Faulty types #972

darklight9811 opened this issue May 29, 2022 · 2 comments

Comments

@darklight9811
Copy link

Describe the bug

Since 2.1.1, the reducers generated by rematch are wrongly typed. They ask for the last state when calling a reducer.

Reproduce Link
link

To Reproduce

Create a model and a store, access the model through the dispatch in the store. You will see that the arguments of the reducer are wrongly typed.

Expected behavior

The reducer to match the function used in the createModel funciton, to not require the store (since if you add it you will break the function call) and have the according type.

Screenshots

image

Desktop

  • OS: Windows, Linux
  • Browser (not related to browser)
  • Version (the last version working is 2.1.0, everything after that is broken)

Additional context

It used to work, now I'm locked in older versions because of this.

@progsmile
Copy link

Duplicate #950

@Mukhammadali
Copy link

I could solve this by adding strict: true to my tsconfig.json compilerOptions. After that, those faulty types disappeared.

{
  "extends": "expo/tsconfig.base.json",
  "compilerOptions": {
    "strict": true,
     ...other params
  },
}

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