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
As of RTK 2.1, you can define a "pre-typed" version of `createDraftSafeSelector` that can have the type for `state` built in. This lets you set up those types once, so you don't have to repeat them each time you call `createDraftSafeSelector`.
Importandusethepre-typed`createTypedDraftSafeSelector`function, and it will automatically know that the `state` argument is of type `RootState`.
101
+
102
+
:::warning Known Limitations
103
+
Currently this approach only works if input selectors are provided as a single array.
104
+
105
+
If you pass the input selectors as separate inline arguments, the parameter types of the result function will not be inferred. As a workaround you can either
106
+
107
+
1. Wrap your input selectors in a single array
108
+
2. You can annotate the parameter types of the result function:
0 commit comments