Estoy aprendiendo reactJS, ¿cómo puedo escribir un valor de AddCategoryModal.jsx <input type"text" id="addValue"/> a objetos en el archivo data.js?
los valores se almacenan en la memoria, se borrarán solos después de la actualización del navegador, quiero agregar el valor del bus para escribir en el objeto en data.js.
en el archivo AddCategoryModal.jsx :
data.push({categoryName:"Bus", lists:['Location']}); // store value from inputen el archivo data.js :
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', ], }, ]