Sunday, September 26, 2021

How to Mapping Props to an Array in React?

Mapping Props to an Array in React

Hello, welcome to In this post, I will tell you, How to Mapping Props to an Array in React? Reactjs is a Javascript Library to build user interface.

Here is the example code for this:
Object.keys() is used to convert the object to array, and create the JSX using

const props = {
  "links": {
    "link1": "",
    "link2": "",
    "link3": "",
    "link4": "",
    "link5": "",
    "link6": ""

const Links = ({ links }) => {
   return (
          Object.keys(links).map((link) => (
            <p key={link}>{ links[link] }</p>

  <Links {...props} />,

<script src=""></script>
<script src=""></script>

<div id="demo"></div>

 There are so many things in reactjs and I will let you know all. If you have any query then please comment.

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, Angular 8, Angular 9, Angular 10, Angular 11, Angular12, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.