index.js:
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<App />
);
App.js:
import React from 'react';
import Shop from './pages/Shop.js';
function App() {
return (
<div className="App">
<Shop/>
</div>
);
}
export default App;
Shop.js
import React from 'react';
import Itemslist from '../components/itemslist.js';
const Shop = () => {
return (
<div>
<Itemslist/>
</div>
);
};
export default Shop;
itemslist.js:
import React from 'react';
import Item from './item.js';
const Itemslist = () => {
return (
<div>
<item id={'1'} text={'hello world'}/>
</div>
);
};
export default Itemslist;
item.js
import React from 'react';
const Item = ({text}) => {
return (
<div>
{text}
</div>
);
};
export default Item;
ошибок не выдыет hello world не выводит