CodeWithHarry / iNotebook-React

INotebook is a React Application for managing personal notes on the cloud
343 stars 193 forks source link

Error with useContext #32

Closed notelyfe closed 2 years ago

notelyfe commented 2 years ago

import React from 'react' import {useContext} from 'react' import noteContext from '../Components/context/NoteState' // import NoteItem from './NoteItem'

const Notes = () => {

const context = useContext(noteContext);                      
console.log(context)

//Problem is here in Context. I am getting the output for noteContext but //unable to get the output for context when doing console.log()

// eslint-disable-next-line
const { notes, setNotes } = context;

return (
    <div>
        <h1>Your Notes</h1>
        {notes.map((note) => {
            // return <NoteItem note={note}/>;
            return note.title;
        })}
    </div>
)

} export default Notes

notelyfe commented 2 years ago

issue resolved