john-smilga/react-beach-resort-project

Issue with Featured Rooms loading

jay4399 opened this issue · 0 comments

I was following your Youtube video on this project and you got the Featured rooms loaded on your Video but however my featured rooms doesnt seem to load and I have the exact code as yours and I dont even get any errors? Any idea what could the issue be? If you need to see the files such as context.js FeaturedRooms.js and Room.js then please let me know!

Thank You!

Here is the FeaturedRooms.js file code.

import React, { Component } from "react"
import Title from "./Title"
import { RoomContext } from "../Context"
import Room from "./Room"
import Loading from "./Loading"

export default class FeaturedRooms extends Component {
    static contextType = RoomContext;

render() {
    let { loading, featuredRooms: rooms } = this.context;

rooms = rooms.map(room => {
    return <Room key={room.id} room={room} /> })
return (
    <section className="featured-rooms">
    <Title title="featured rooms" />
    <div className="featured-rooms-center">
      {loading ? <Loading /> : rooms }
    </div>
  </section>
    )
   }
 }