I work on my CV web and I do it on react. The web site works very well but I try now to create thanks to a web admin page a page where I can add experiences when I desir. The issue is the following sentence: I can create data but the data when I refresh the webpage on localhost disappears. as is : it desappers to be : need that this new experience be created and written on the constante. Is it normal ? My data is in a constant on my IDE and I call it on all my web page (bdd.jsx). I use a button whom defined the json structure I need thanks to a form and data stocked on useState and then I use the push method to do it. It works but data disappears when i refresh... :(
Maybe I'm wrong somewhere maybe it's easier in the otherway so thank you for your help.. Cyprien
**bdd.jsx**
const bdd = [
{
{
"id":1,
"nomFonction": "Consulting",
"nomEntreprise":"dogs ...",
},
{
"id":2,
"nomFonction": "Consulting",
"nomEntreprise":"dogs ...",
}
]
**page.js**
const [function,setFunction] = useState('');
const [company,setCompany] = useState('');
const handleExperiences = () => {
let value =
{
"id":bdd.length,
"nomFonction":function,
"nomEntreprise":company,
}
bdd.push(value);
}