REACT- 如何提交数据库中的数据?

REACT- How do I do to submit the data in the database?

我基于使用 2 个 json 文件在 REACT 中开发了我所有的前端。现在,我想在刷新选项卡时提交表单、推送和获取数据、保存输入字段中的数据。我的数据表 (MYSQL) 有一个潜在的架构。在我的数据库中 get/push 此信息旁边我应该做什么?我以前从未做过网络front/backend。

这是我的code

你可以使用axios,method你可以使用POST 像这样:

handleSubmit = (event) => {
    fetch('http://localhost:3000/store-data', {
        method: 'POST',
              }).then(function(response) {
        console.log(response)
        return response.json();
      });
 
    event.preventDefault();
}

您在按钮上使用此事件 handleSubmit