Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda