#reactjs #react-native #redux #react-redux #expo
#reactjs #react-родной #сокращение #реагирует-redux #выставка
Вопрос:
Я пытаюсь подключить расширение Redux dev tools к React Native app с помощью expo. Я хочу подключить расширение Redux к приложению expo, ниже приведены все подробности о зависимостях файлов package.json и store.js код.
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import authReducer from './reducers/authReducer';
import uiReducer from './reducers/uiReducer';
const initialState = {};
const middleware = [thunk];
const reducers = combineReducers({
auth: authReducer,
UI: uiReducer
});
const composeEnhancers = (
window.__REDUX_DEVTOOLS_EXTENSION__
amp;amp; window.__REDUX_DEVTOOLS_EXTENSION__()
) || compose;
const store = createStore(
reducers,
initialState,
composeEnhancers(applyMiddleware(...middleware))
);
export default store;
зависимости от файлов package.json, уже установлен отладчик react, и он открывается при запуске приложения в браузере Chrome:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"postinstall": "rndebugger://set-debugger-loc?host=localhostamp;port=19001"
},
"dependencies": {
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/native": "^5.7.3",
"expo": "~38.0.8",
"expo-status-bar": "^1.0.2",
"formik": "^2.1.5",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.9.0",
"react-native-safe-area-context": "~3.0.7",
"react-native-screens": "~2.9.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.4.0",
"react-navigation-drawer": "^2.5.0",
"react-navigation-stack": "^2.8.2",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"babel-preset-expo": "~8.1.0",
"open": "^7.2.1",
"react-devtools": "^4.8.2",
"react-native-debugger": "^1.1.0",
"react-native-debugger-open": "^0.3.25",
"redux-devtools-extension": "^2.13.8"
},
"private": true
}