Update dependency react-redux to v9.1.0 #285

Merged
kjuulh merged 1 commits from renovate/all into main 2024-01-12 19:17:15 +01:00
Owner

This PR contains the following updates:

Package Type Update Change
react-redux dependencies minor 9.0.4 -> 9.1.0

Release Notes

reduxjs/react-redux

v9.1.0

Compare Source

This minor release adds a new syntax for pre-typing hooks.

.withTypes

Previously, the approach for "pre-typing" hooks with your app settings was a little varied. The result would look something like the below:

import type { TypedUseSelectorHook } from "react-redux"
import { useDispatch, useSelector, useStore } from "react-redux"
import type { AppDispatch, AppStore, RootState } from "./store"

export const useAppDispatch: () => AppDispatch = useDispatch
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
export const useAppStore = useStore as () => AppStore

React Redux v9.1.0 adds a new .withTypes method to each of these hooks, analogous to the .withTypes method found on Redux Toolkit's createAsyncThunk.

The setup now becomes:

import { useDispatch, useSelector, useStore } from "react-redux"
import type { AppDispatch, AppStore, RootState } from "./store"

export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
export const useAppSelector = useSelector.withTypes<RootState>()
export const useAppStore = useStore.withTypes<AppStore>()

What's Changed

New Contributors

Full Changelog: https://github.com/reduxjs/react-redux/compare/v9.0.4...v9.1.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [react-redux](https://github.com/reduxjs/react-redux) | dependencies | minor | [`9.0.4` -> `9.1.0`](https://renovatebot.com/diffs/npm/react-redux/9.0.4/9.1.0) | --- ### Release Notes <details> <summary>reduxjs/react-redux</summary> ### [`v9.1.0`](https://github.com/reduxjs/react-redux/releases/tag/v9.1.0) [Compare Source](https://github.com/reduxjs/react-redux/compare/v9.0.4...v9.1.0) This **minor release** adds a new syntax for pre-typing hooks. #### `.withTypes` Previously, the approach for "pre-typing" hooks with your app settings was a little varied. The result would look something like the below: ```ts import type { TypedUseSelectorHook } from "react-redux" import { useDispatch, useSelector, useStore } from "react-redux" import type { AppDispatch, AppStore, RootState } from "./store" export const useAppDispatch: () => AppDispatch = useDispatch export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector export const useAppStore = useStore as () => AppStore ``` React Redux v9.1.0 adds a new `.withTypes` method to each of these hooks, analogous to the [`.withTypes`](https://redux-toolkit.js.org/usage/usage-with-typescript#defining-a-pre-typed-createasyncthunk) method found on Redux Toolkit's `createAsyncThunk`. The setup now becomes: ```ts import { useDispatch, useSelector, useStore } from "react-redux" import type { AppDispatch, AppStore, RootState } from "./store" export const useAppDispatch = useDispatch.withTypes<AppDispatch>() export const useAppSelector = useSelector.withTypes<RootState>() export const useAppStore = useStore.withTypes<AppStore>() ``` #### What's Changed - Update hooks.md — reselect usage with multiple instances simplified by [@&#8203;VorontsovIE](https://github.com/VorontsovIE) in https://github.com/reduxjs/react-redux/pull/2110 - Modernize ESLint configuration by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/react-redux/pull/2115 - Introduce pre-typed hooks via `hook.withTypes<RootState>()` method by [@&#8203;aryaemami59](https://github.com/aryaemami59) in https://github.com/reduxjs/react-redux/pull/2114 #### New Contributors - [@&#8203;VorontsovIE](https://github.com/VorontsovIE) made their first contribution in https://github.com/reduxjs/react-redux/pull/2110 **Full Changelog**: https://github.com/reduxjs/react-redux/compare/v9.0.4...v9.1.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=-->
kjuulh added 1 commit 2024-01-12 18:48:21 +01:00
Update dependency react-redux to v9.1.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
5979f9778f
kjuulh merged commit 5979f9778f into main 2024-01-12 19:17:15 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kjuulh/vidow#285
No description provided.