@@ -740,7 +740,15 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
740
740
Definitions
741
741
>
742
742
const dispatch = useDispatch < ThunkDispatch < any , any , UnknownAction > > ( )
743
- const subscriptionSelectorsRef = useRef < SubscriptionSelectors > ( )
743
+
744
+ // TODO: Change this to `useRef<SubscriptionSelectors>(undefined)` after upgrading to React 19.
745
+ /**
746
+ * @todo Change this to `useRef<SubscriptionSelectors>(undefined)` after upgrading to React 19.
747
+ */
748
+ const subscriptionSelectorsRef = useRef <
749
+ SubscriptionSelectors | undefined
750
+ > ( undefined )
751
+
744
752
if ( ! subscriptionSelectorsRef . current ) {
745
753
const returnedValue = dispatch (
746
754
api . internalActions . internal_getRTKQSubscriptions ( ) ,
@@ -781,7 +789,13 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
781
789
782
790
const lastRenderHadSubscription = useRef ( false )
783
791
784
- const promiseRef = useRef < QueryActionCreatorResult < any > > ( )
792
+ // TODO: Change this to `useRef<QueryActionCreatorResult<any>>(undefined)` after upgrading to React 19.
793
+ /**
794
+ * @todo Change this to `useRef<QueryActionCreatorResult<any>>(undefined)` after upgrading to React 19.
795
+ */
796
+ const promiseRef = useRef < QueryActionCreatorResult < any > | undefined > (
797
+ undefined ,
798
+ )
785
799
786
800
let { queryCacheKey, requestId } = promiseRef . current || { }
787
801
@@ -886,7 +900,14 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
886
900
const dispatch = useDispatch < ThunkDispatch < any , any , UnknownAction > > ( )
887
901
888
902
const [ arg , setArg ] = useState < any > ( UNINITIALIZED_VALUE )
889
- const promiseRef = useRef < QueryActionCreatorResult < any > | undefined > ( )
903
+
904
+ // TODO: Change this to `useRef<QueryActionCreatorResult<any>>(undefined)` after upgrading to React 19.
905
+ /**
906
+ * @todo Change this to `useRef<QueryActionCreatorResult<any>>(undefined)` after upgrading to React 19.
907
+ */
908
+ const promiseRef = useRef < QueryActionCreatorResult < any > | undefined > (
909
+ undefined ,
910
+ )
890
911
891
912
const stableSubscriptionOptions = useShallowStableValue ( {
892
913
refetchOnReconnect,
@@ -966,7 +987,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
966
987
967
988
type ApiRootState = Parameters < ReturnType < typeof select > > [ 0 ]
968
989
969
- const lastValue = useRef < any > ( )
990
+ const lastValue = useRef < any > ( undefined )
970
991
971
992
const selectDefaultResult : Selector < ApiRootState , any , [ any ] > = useMemo (
972
993
( ) =>
0 commit comments