Выставляю полное приложение измененное
index.js
import React, {createContext} from 'react';
import ReactDOM from 'react-dom';
import App from './App';
export const Context = createContext(null)
const arrayse={'id':1,'description':'desc'};
ReactDOM.render(
<Context.Provider value={{
arrayse:arrayse
}}>
<App />
</Context.Provider>,
document.getElementById('root')
);
app.js
import React from 'react';
import Shop from './pages/Shop'
function App() {
return (
<Shop/>
)
}
export default App;
Shop.js
import React from 'react';
import ItemsList from '../components/itemsList';
function Shop() {
return (
<ItemsList/>
);
}
export default Shop;
itemsList
import React,{useContext} from 'react';
import Item from './item';
import {Context} from "../index";
function ItemsList() {
const {arrayse} = useContext(Context)
return (
<Item arrayse={arrayse}/>
);
}
export default ItemsList;
item остается неизменным