Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!