Monday, June 17, 2024

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.

the authortherichpost
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 14, Angular 15, Angular 16, Angular 17, 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.