I am fetching data from http://127.0.0.1:8000/api/todos receiving array using app level state how should i populate the initial state in Context API ?
const initialState={
todos:[]
,
current:null
}
const [state, dispatch] = useReducer(Todoreducer, initialState)
fetch('http://127.0.0.1:8000/api/todos')
.then(data => data.json())
.then( res =>
// console.log(res)
state.todos= res
)