我的 ReactJS 应用程序在http://localhost:3000/中运行。我将以下表单数据作为 POST 请求接收到我的 React 页面
<form action="http://localhost:3000/" method="post">
Employee Id: <input type="text" name="eid"><br>
Department Id: <input type="text" name="did"><br>
<input type="submit" value="Submit">
</form>
Run Code Online (Sandbox Code Playgroud)
我的 React 应用程序应该能够处理此 POST 请求并呈现 UI,如下所示
<h1>{eid}</h1>
<h1>{did}</h1>
Run Code Online (Sandbox Code Playgroud)
我能够使用 React 路由器处理 GET 请求,但很难处理 POST 请求。我怎样才能实现这个目标?