Adding space to array list item in React

I have some data stored in an array:

const currencies =['USD','EUR','AUD','CNY','AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS',
'AUD', 'AWG','AZN', 'BAM', 'BBD', 'BDT', 'BGN', ' BHD', 'BIF', 'BMD'
,'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BWP', 'BYN' ]

const firstCurrencies = currencies.slice(0,4)

My React component relevant code here:

<div className="flex flex-col">   
                      <h3>Select a currency</h3>
                      <div className="flex flex-row z-40">
                        {firstCurrencies.map((firstCurrency,index) =>(
                          <div className="">
                            <div key={index} className="">
                            <span><Link to="#">{firstCurrency}</Link></span>
                            </div>
                            <hr></hr>
                          </div>  
                        ))}
                      </div>
                      </div>  

What is the best way to add space to after the item.

At the moment its displaying like this:

enter image description here

The idea is to have the currencies separated by a space.

I have tried firstCurrencies.join(',') at the top but giving me an error.

Any tips?

53 thoughts on “Adding space to array list item in React”

  1. Pingback: easy keto
  2. Nice post. I learn something totally new and challenging
    on sites I stumbleupon everyday. It will always
    be exciting to read through articles from other writers and use a little something from
    other websites.

    Reply
  3. Thank you for some other excellent article.
    The place else may anybody get that type of info
    in such a perfect means of writing? I’ve a presentation next week, and I am on the search
    for such info.

    Reply
  4. Hello there! This is my first comment here so I just wanted
    to give a quick shout out and tell you I truly enjoy reading through
    your posts. Can you suggest any other blogs/websites/forums
    that deal with the same subjects? Many thanks!

    Reply

Leave a Comment