Omri Kochavi
Omri Kochavi

Reputation: 1

Using RTK Query from the umd RTK release

I am using Redux Toolkit (v1.8) from the umd build, as I am using it inside a platform that does not enable package management integration.

I was trying to access RTK Query, but could not find a way to access it through the global exported by the umd script.

I was wondering if:

  1. I missed something and it's there, or
  2. It is necessary to use another script, or
  3. It is not possible to use RTK Query from the umd script

Thanks!

Upvotes: 0

Views: 166

Answers (1)

phry
phry

Reputation: 44216

There is a UMD build at https://unpkg.com/browse/@reduxjs/[email protected]/dist/query/rtk-query.umd.js that will populate window.RTKQ.

Generally you should try to use the ESM build instead - most modern environments should be able to load that unbundled. Any kind of UMD build will probably be removed in RTK 2.0 - it is just not up to date to ship UMD any more.

Just out of curiosity: in what environment are you working? I cannot imagine anything that would work with only an UMD build.

Upvotes: 0

Related Questions