Skip to content
Advertisement

How to map JSON data in react js?

I want to map JSON data in key-value manner. I tried it doing on stackblitz but it is showing error.

THE CODE I WROTE:

JavaScript

THE ERROR I AM GETTING IS:

Error in /turbo_modules/react-dom@17.0.0/cjs/react-dom.development.js (26083:13) Target container is not a DOM element.

https://stackblitz.com/edit/react-lyrp91

Advertisement

Answer

You must export default react components. I got it working in a sandbox (link), by changing this line

JavaScript

to this

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement