Replies: 1 comment
-
@emmac3 where and how are you needing to call My understanding is that you can't render a Context provider on the server, but I don't think just importing it will break anything (?). Also, what's "rtqp" ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I have some endpoints that I would like to call only on the server side. Hence we cannot call
createAPI
because upon import of react redux it creats a context.CreateApi
depends on react redux and context cannot be used on the server. Therefore we have to leverage the api directly on the server without rtqp and we must inject the endpoints separately. (see https://github.com/reduxjs/react-redux/blob/89a86805f2fcf9e8fbd2d1dae345ec791de4a71f/src/components/Context.ts#L14)I have my endpoints specified in a separate file and is using
injectEndpoints
to add them to the API slice. Since my endpoints are defined separately from the API slice, what is the best approach to use utility functions such asupdateQueryData
in callbacks likeonQueryStarted
? I can't just pass in the slice because it doesn't yet know about the endpoint.Beta Was this translation helpful? Give feedback.
All reactions