Add Storage component to homepage

This commit is contained in:
Ray 2023-10-24 07:47:41 +00:00 committed by GitHub
parent 93b4f2de62
commit d37bd54725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -3,11 +3,14 @@ import Col from 'react-bootstrap/Col';
import Container from "react-bootstrap/Container"; import Container from "react-bootstrap/Container";
import Card from "react-bootstrap/Card"; 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 ) { export function Home ( props ) {
const [ books, setBooks ] = useState([]) const [ books, setBooks ] = useState([])
const Storage = useContext( StorageContext )
useEffect( () => { useEffect( () => {
setBooks( props.items ) setBooks( props.items )
console.log( props.items ) console.log( props.items )