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

280
Visualizações
how to written value from input text to object in .js file?

I'm learning reactJS, how can I write a value from AddCategoryModal.jsx <input type"text" id="addValue"/> to objects in data.js file?

the values store in memory, it will wipe itself after the browser refresh, I want to add bus value to write on object in data.js.

in AddCategoryModal.jsx file:

data.push({categoryName:"Bus", lists:['Location']}); // store value from input

in data.js file:

export const data = [

  {
      categoryName: 'Restaurants',
      lists: [
          'Can I please have the menu',
          'Is my order ready?',
          'What are your main dishes',
          'Where is the manager?',
          'May I sit in this table?',
      ],
  },
  {
      categoryName: 'Security Guard',
      lists: [
          'Can you please assist me?',
          'Can i come in , I came to visit my friend . I have an appoinment',
          'I am lose, can you help ,e with directions',
      ],
  },
  {
      categoryName: 'Garage',
      lists: [
          'How much is 1Litre petrol',
      ],
  },
]
about 4 years ago · Juan Pablo Isaza
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