From d37bd5472555ba596d01f851de217a8b5a768d15 Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Tue, 24 Oct 2023 07:47:41 +0000 Subject: [PATCH] Add Storage component to homepage --- src/pages/Home.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Home.js b/src/pages/Home.js index d99b1fb..327faa2 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -3,11 +3,14 @@ import Col from 'react-bootstrap/Col'; import Container from "react-bootstrap/Container"; import Card from "react-bootstrap/Card"; -import { useState, useEffect } from "react" +import { useState, useEffect, useContext } from "react" +import { StorageContext } from '../contexts/StorageContext'; export function Home ( props ) { const [ books, setBooks ] = useState([]) + const Storage = useContext( StorageContext ) + useEffect( () => { setBooks( props.items ) console.log( props.items )