Home > OS >  How can i solve this issue ? TypeError: Cannot read properties of undefined (reading 'map'
How can i solve this issue ? TypeError: Cannot read properties of undefined (reading 'map'

Time:11-05

Hierarchy Structure Picture : Edit how-can-i-solve-this-issue-typeerror-cannot-read-properties-of-undefined-rea

V1 Accordion API

This version has the Accordion, Accordion.Toggle, and Accordion.Collapse components.

V2 Accordion API

The v2 version has a few more options with Accordion, Accordion.Item, Accordion.Header, Accordion.Body, Accordion.Button, and Accordion.Collapse.

I suggest sticking to v1.6.4 and keeping your existing code working. If you want, or need, to upgrade then it's a bit unclear what immediate component changes you'll need to have a similarly working UI/UX, though I suspect the new accordion components will replace some of the card components currently used.

You can use either named or default export of the notes though, just don't use the module.exports.

CodePudding user response:

The problem I have find is about the import you do of your notes.js file. Using {} you try to get a "notes" object inside your "notes" array. I have tested it, without {} and leaving your notes.js file as you have it, and work for me.

 import notes from '../../data/notes.js'

I hope it can solve your problem.

  • Related