I have an array at the root level of my Redux store but for some reason my view is treating it as an object.
Code Snippet:
const notes = useSelector(state => state.notes)
...
<p>Notes</p>
<p>{typeof notes}</p>
<p>{JSON.stringify(notes)}</p>
<p>{JSON.stringify(notes[0])}</p>
I just want to make sure I'm not crazy and looking at the Redux docs it looks like this should be acceptable. Why might this not be working?
Edit
I'm glad I am not crazy, I guess my follow up question is why do I not see anything when I try:
export default function NotesTab() {
const notes = useSelector(state => state.notes)
return (
<div className="flex flex-col w-full h-full justify-center items-center">
{notes.forEach(note => (
<p>Test</p>
))}
</div>
)
}

<p>notes[0].content</p>. As for thetypeof, , in JavaScript arrays aren't actually a type, they are a class so an instance of an array is an object.why do I not see anything. Maybe tryArray#mapinstead ofArray#forEach. Example:{notes.map(note => (<p>Test</p>)}. Render something if there are no notes, so you can distinguish between your own error and an empty application state.{(!notes || !notes.length) && (<p>No Notes here</p>)}#mapwhich will return an array of JSX expressions instead of iterating over your notes with#forEach