skip to Main Content

I’m trying to display both first name and last name from API data.

<CustomersTable
 name={customers.first_name} {customers.last_name}
 id={customers.uid}
 />

2

Answers


  1. you can do like this

    name={`${customers.first_name} ${customers.last_name}`}
    

    or

    name={customers.first_name+' '+customers.last_name}
    
    Login or Signup to reply.
  2. Considering the information you gave, you need to concatenate them using a string template or concatenation operator.

    <CustomersTable
    name={${customers.first_name} ${customers.last_name}}
    id={customers.uid}
    />

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search