#Hello, I wrote basic react app and used vite.
38 messages · Page 1 of 1 (latest)
npm run dev
I reaiiy dont get it, why just a white screen shown,
I sent scss
and its modular and simple
2 secs, let me get to my pc
alright, I shared repo, pls check or clone maybe
Are you getting any errors in the browser console?
Not the console in VSCode, the web browser console
ok
2 secs
Ok, first problem. In your Directory component you aren't returning anything. Your component won't render anything without a return statement.
Same with your MenuItem component
hmm, I changed ```import "./menu-item.styles.scss";
const MenuItem = ({ menu }) => {
const { imageUrl, title, price } = menu;
render(
<div className="menu-container">
<div
className="background-img"
style={{ backgroundImage: url(${imageUrl}) }}
/>
<div className="menu-body-container">
<h2>{title}</h2>
<p>{price}</p>
</div>
</div>
);
};
export default MenuItem;
import "./directory.styles.scss";
const Directory = ({ menus }) => {
return (
<div className="menu-container">
{menus.map((menu) => (
<MenuItem key={menu.id} menu={menu} />
))}
</div>
);
};
export default Directory;
but
So, read what the error says. menu-item.component.js file, line 5 - render is not defined
not working for me🤔
What are you expecting to see there?
like that
Well, the files are all working and the scss is being compiled properly. If the style isn't what you want then that's a different issue