Issue 1:
Am trying to setup Context Api for my project but i get an error that i cannot wrap my head around, i have two files one for the data context,

createDataContext is the name of the file

import React, {useReducer} from 'react';

export default (reducer, actions, defaultValue) => {

const Context = React.createContext();

const Provider = ({children}) => {

const [state, dispatch] = useReducer(reducer, defaultValue);

const boundActions = {};

for (let key in actions){

boundActions [key] = actionskey;

}

return(

<Context.Provider value={{state, ...boundActions}}>

{ children }

</Context.Provider>

);

};

return(Context, Provider);

};

AuthContext js file

import createDataContext from './createDataContext';

const authReducer = (state, action) => {

switch(action.type){

default:

return state;

}

};

export const {Provider, Context} = createDataContext(

authReducer,

{},

{ isSignedIn: false }

);

And the Consumer App which has a switch navigator

App.js

import React from 'react';

import {createAppContainer, createSwitchNavigator} from 'react-navigation';

import {createStackNavigator} from 'react-navigation-stack';

import { createDrawerNavigator } from 'react-navigation-drawer';

import Login from './src/screens/Login';

import Register from './src/screens/Register';

import Account from './src/screens/Account';

import Earnings from './src/screens/Earnings';

import Scheduledrides from './src/screens/Scheduledrides';

import Home from './src/screens/Home';

import {Provider } from './src/Context/AuthContext';

const Screens = createSwitchNavigator({

loginFlow: createStackNavigator({

Login: Login,

Register:Register,

}),

mainFlow: createDrawerNavigator({

Home: Home,

Account: Account,

Earnings: Earnings,

Scheduledrides: Scheduledrides,

}),

});

const App = createAppContainer(Screens);

export default () => {

return(

);

};

Below is the error i get, thanks in advance

Issue 2:
Am trying to setup Context Api for my project but i get an error that i cannot wrap my head around, i have two files one for the data context,

createDataContext is the name of the file

import React, {useReducer} from 'react';

export default (reducer, actions, defaultValue) => {

const Context = React.createContext();
const Provider = ({children}) => {
const [state, dispatch] = useReducer(reducer, defaultValue);

const boundActions = {};
for (let key in actions){
boundActions [key] = actions[key](dispatch);
}
return(
<Context.Provider value={{state, ...boundActions}}>
{ children }
</Context.Provider>
);

};

return(Context, Provider);

};

AuthContext js file

import createDataContext from './createDataContext';

const authReducer = (state, action) => {

switch(action.type){

default:

return state;

}

};

export const {Provider, Context} = createDataContext(

authReducer,

{},

{ isSignedIn: false }

);

And the Consumer App which has a switch navigator

App.js

import React from 'react';

import {createAppContainer, createSwitchNavigator} from 'react-navigation';

import {createStackNavigator} from 'react-navigation-stack';

import { createDrawerNavigator } from 'react-navigation-drawer';

import Login from './src/screens/Login';

import Register from './src/screens/Register';

import Account from './src/screens/Account';

import Earnings from './src/screens/Earnings';

import Scheduledrides from './src/screens/Scheduledrides';

import Home from './src/screens/Home';

import {Provider } from './src/Context/AuthContext';

const Screens = createSwitchNavigator({

loginFlow: createStackNavigator({

Login: Login,

Register:Register,

}),

mainFlow: createDrawerNavigator({

Home: Home,

Account: Account,

Earnings: Earnings,

Scheduledrides: Scheduledrides,

}),

});

const App = createAppContainer(Screens);

export default () => {

return(

);

};

Below is the error i get, thanks in advance