redux-toolkit
redux-toolkit copied to clipboard
Issues using RTK Query outside function components
@markerikson , this might be a bit of a hijack... sorry. I have a use case that seems pretty reasonable but I just can't get started. I have been happily using RTK for few years and now want to start using RTK Query. Within function components with hooks (as long as I add a few
@ts-ignores due to this), it seems to be working ok.Unfortunately, I need to be able to also use the store outside of function components (in
infernoclass components viainferno-redux-> I have some super-high-performance needs and plainreactis just too slow...) and I just can't get started. I can't get any of theexampleshere to run and there don't seem to be any instructions on the expected way to run them. The supported way to install now appears to be withvite(which I have also been using for years) but most/all of the examples still usecreate-react-app, and I'm getting various different errors trying to install. Because there I couldn't find instructions, I don't know whether I'm just holding it wrong.It is probably temporary but codesandbox also seems a bit foobared. I tried to download the class-based components example but it refused to download (something about Chrome now refusing sandbox downloads?) and there are also errors when trying to create a github repo.
So I am now a couple of hours in and still can't get an official example running. Is there something else I should be doing? Thanks!
Originally posted by @AntonOfTheWoods in https://github.com/reduxjs/redux-toolkit/issues/3910#issuecomment-1859440783