adrianhajdin / project_e_commerce

This is a code repository for the corresponding video tutorial. In this video, we're going to build a fully functional eCommerce application using commerce.js.

Home Page:https://jsmastery.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blank page on importing products from commerce.js

yassin246 opened this issue · comments

When we were using product mocks, it was working fine, when i started using the commerce.js ones, the website compiled but it was just a blank screen

`import React from 'react';
import { Card, CardMedia, CardContent, CardActions, Typography, IconButton } from '@material-ui/core';
import { AddShoppingCart } from '@material-ui/icons';

import useStyles from './styles';

const Product = ({ product, onAddToCart }) => {
const classes = useStyles();

const handleAddToCart = () => onAddToCart(product.id, 1);

return (





{product.name}


${product.price.formatted}


<Typography dangerouslySetInnerHTML={{ __html: product.description }} variant="body2" color="textSecondary" component="p" />







);
};

export default Product;`