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
In the intermediate tutorial you showcase a really common pattern of importing an action creator from a slice and then map it to props using connect(). I'm struggling to decide what the right way to handle this is. Since redux-toolkit seems to have some strong opinions I was hoping for one about this topic.
I'm leaning towards his #1 solution of just disabling this eslint rule in my project. His #3 violates react/destructuring-assignment eslint rule.
Only other option imo is #2 where you rename the connected action creator with some strict naming convention but that just doesn't feel great to me either.
What do the folks here recommend? Based on the tutorial it seems you would also lean towards just allowing variable shadowing in this case?
The text was updated successfully, but these errors were encountered:
I'd say that answer is a lot more thorough than anything I could offer on this topic :)
Personally, the "shadowing" thing has never been a point of concern for me, and not a rule I've ever actually used.
As Dan has commented a number of times: lint rules are supposed to help you, not annoy you. Disable rules that aren't actually providing value.
Note that this isn't an issue with our React-Redux hooks API, as there's no action creator binding going on. See the Advanced Tutorial for examples of using that.
In the intermediate tutorial you showcase a really common pattern of importing an action creator from a slice and then map it to props using connect(). I'm struggling to decide what the right way to handle this is. Since redux-toolkit seems to have some strong opinions I was hoping for one about this topic.
There's a great answer on SO about this same topic ( https://stackoverflow.com/a/42337137 ).
I'm leaning towards his #1 solution of just disabling this eslint rule in my project. His #3 violates react/destructuring-assignment eslint rule.
Only other option imo is #2 where you rename the connected action creator with some strict naming convention but that just doesn't feel great to me either.
What do the folks here recommend? Based on the tutorial it seems you would also lean towards just allowing variable shadowing in this case?
The text was updated successfully, but these errors were encountered: