выдает ошибку array1.map is not a function
index.js
import React, {createContext} from 'react';
import ReactDOM from 'react-dom';
import App from './App';
export const Context = createContext(null)
const array1={'id':1,'description':'desc'};
ReactDOM.render(
<Context.Provider value={{
array1:array1
}}>
<App />
</Context.Provider>,
document.getElementById('root')
);
app.js
import React,{useContext} from 'react';
import {Context} from "./index";
import Item from './components/item';
function App() {
const {array1} = useContext(Context)
const b=array1.map((arrays) =>
<div>
<h1>id:{arrays.id}</h1>
<p>desc: arrays.description</p>
</div>
)
return (
{b}
);
}
export default App;