TypeError: Cannot read property 'map' of undefined
This error keeps coming up and will not let me run my website. Any help or assistance would be great. I just need to figure out what exactly to change in order to get this running.
import React from "react";
import styled from "styled-components";
import { AppContext } from "../App/AppProvider";
import PriceTile from "./PriceTile";
export default function() {
return (
<AppContext.Consumer>
{({ prices }) => (
<PriceGrid>
{prices.map((price, index) => (
<PriceTile key={`priceTile-${index}`} index={index} price={price} />
))}
</PriceGrid>
)}
</AppContext.Consumer>
);
}
AppContext.Provider