Javascript 获得';无效挂钩错误';在我的react redux商店

Javascript 获得';无效挂钩错误';在我的react redux商店,javascript,react-native,redux,Javascript,React Native,Redux,在expo中加载我的react本机应用程序时出现以下错误: Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as

在expo中加载我的react本机应用程序时出现以下错误:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
到目前为止,我已经缩小到我的redux商店。当导出存储时,它导致了无效的钩子错误。它抛出不允许的useContext,因为它不在功能组件中。我已经检查了错误3,在控制台中使用npm ls react仅显示1个版本。我确信我在遵守规则

store.js

import { createStore, combineReducers } from "redux";
import userReducer from "./Reducer/reducer";

const rootReducer = combineReducers({
    userReducer: userReducer,
})

const configureStore = createStore(rootReducer);

export default configureStore;
actions.js

import { SET_USER, LOGOUT } from "../Actions/types";

export const setUser = (data) => ({
    type: SET_USER,
    data: data
})

export const logout = (data) => ({
    type: LOGOUT,
    data: data
})
reducer.js

import { SET_USER, LOGOUT } from "../Actions/types";

const userReducer = (state = null, action) => {
    switch (action.type) {
        case SET_USER:
            state = action.data
            return state;

        case LOGOUT:
            id: null
            return state;

        default:
            return state;
    }
}

export default userReducer;

无效钩子调用的错误在哪里?找它真是太费劲了。

这里没有与钩子有关的东西。你能发一份你的呼叫堆栈吗。