I'm trying to add some new data to an existing JSON file from text input. I use React Native and I store some data in JSON file called PartyInfo.json, when I fill out a form I want the data will be passed and stored in the PartyInfo.json file.
const PartyInfo = require('../PartyInfo.json');
let party = {
name: this.state.name,
info: this.state.info,
date: this.state.date,
price: this.state.price,
};
let data = JSON.stringify(party);
PartyInfo.writeFile('PartyInfo.json', data);
I have tried to follow some answers to similar questions but nothing worked... thanks in advance.
AsyncStorage