Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

71
Visualizações
How do i pass a javascript object in an input feild

hello i am trying to map items stored in my redux into a form . I created a component called PAYMENT.js that gives a format of how the item should be arranged THIS IS A REACT PROJECT

PAYMENT.JS

import React from "react";

function Payment({ name, price, count, itemSize }) {

  return (
    <div>
      <p> {name}, {itemSize}, {count} </p>
    </div>
  );
}

export default Payment;

I want it to be mapped in an input feild , this feild would be readable .

Here is it

<div class="telephone">
                <label for="name"></label>
                <input
                  className="payment_form"
                  type="text"
                  placeholder="My address"
                  name="telephone"
                  value={items.map((item, id) => (
                    <Payment
                      id={items.id}
                      key={id}
                      name={item.name}
                      price={item.price}
                      size={item.size}
                      image1={item.image1}
                      itemSize={item.itemSize}
                      count={item.count}
                    />
                  ))}
                  id="telephone_input"
                  required
                />
              </div>

i get [OBJECT , OBJECT ][OBJECT , OBJECT ] Instead of the actual object . Putting the map function in a p tag and iget the value of the items in the redux

<p>
                {" "}
                {items.map((item, id) => (
                  <Payment
                    id={items.id}
                    key={id}
                    name={item.name}
                    price={item.price}
                    size={item.size}
                    image1={item.image1}
                    itemSize={item.itemSize}
                    count={item.count}
                  />
                ))}
              </p>

OUTPUT Von dutch pink, Xtra large, 1

Von dutch camoeo, Xtra large, 2

Von dutch pink, Xtra large, 3

I want this out put to show in the input feild so i can send it over

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

note that you should not give the attribute "value" an array value because a value attribute must be a string

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda