shallowEqual breaks typed selector return type
See original GitHub issueWhat version of React, ReactDOM/React Native, Redux, and React Redux are you using?
- React: 18.2.0
- ReactDOM/React Native: 18.2.0
- Redux: 4.2.0
- React Redux: 8.0.4
What is the current behavior?
without shallowEqual
type inferred correctly
otherwise it breaks
What is the expected behavior?
types infer correctly with shallowEqual
Which browser and OS are affected by this issue?
No response
Did this work in previous versions of React Redux?
- Yes
Issue Analytics
- State:
- Created a year ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
shallowEqual should be generic · Issue #1348 · reduxjs/react ...
When using TypeScript, the return type of useSelector() gets automatically inferred from the arguments passed, which is great.
Read more >React's useSelector with array of objects - Stack Overflow
This approach causes a rerender whenever any of the objects in the array change :/ const Message = () => { const data...
Read more >Redux Essentials, Part 6: Performance and Normalizing Data
The official Redux Essentials tutorial: learn how to improve app performance and structure data correctly.
Read more >enzyme-shallow-equal | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >How to make an offline first React App - LinkedIn
app.todoItem, }; }, shallowEqual); const dispatch = useDispatch(); // redux hook methods end return ( <> <Input type="text" name= ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’ll need a few type tests for that before @markerikson pulls the lever on that - I’ll try to get to that in the next few days. Meanwhile, that CI build should work nicely I hope?
@phryneas i get it, i’m working on pretty old project and unfortunatly it started with non strict rules. Anyway, thank you a lot!