1

Q How to use configureStore on an offline coding app?

I am trying to use react-redux in an android coding app. And I included the umd code like this:

<script type='text/javascript' src='js/lib/babel.min.js'></script>
<script type='text/javascript' src='js/lib/react.development.js'></script>
<script type='text/javascript' src='js/lib/react-dom.development.js'></script>
<script type='text/javascript' src='js/lib/redux.js'></script>
<script type='text/javascript' src='js/lib/react-redux.js'></script>
<script type='text/javascript' src='js/lib/redux-toolkit.umd.js'></script>
<script type='text/babel' src='js/app/app.js'></script>

I can use <Provider> and createStore() and combineReducers() by prefixing them with Redux like Redux.createStore(). The problem is I cannot use configureStore().

I tried configureStore

Redux.configureStore

ReduxToolkit.configureStore

and more, either configureStore() is not defined or the module doesn't exist.

Drew Reese
207k20 gold badges285 silver badges294 bronze badges
asked May 11, 2023 at 6:27

1 Answer 1

2

Based on the Getting Started documentation it appears to be on the global window object.

It is also available as a precompiled UMD package that defines a window.RTK global variable. The UMD package can be used as a <script> tag directly.

It looks like configureStore could be accessed as

window.RTK.configureStore

or maybe just

RTK.configureStore
answered May 11, 2023 at 7:01
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.