How to send form data from react to express
const reactData = [{ id: 1, name:' Tom'}, { id: 2, name:' Sarah'}];
const url = localhost:4000/api/users/register;
let sendData = () => {
axios.post(url, reactData)
.then(res => console.log('Data send'))
.catch(err => console.log(err.data))
}const url = localhost:4000/api/users/register;
const usersData= [];
let getData = () => {
axios.get(url)
.then(res => usersData.push(res.data))
.catch(err => console.log(err.data))
}
Also in JavaScript:
- select onchange jquery get the selected option data attribute
- span change jquery
- javascript auto scroll on bottom
- e.target javascript
- javascript onclick open url same window
- memento database javascript list
- Node Sass could not find a binding for your current environment
- js test if string
- javascript range of integers
- javascript reverse each string element in array
- detect if two line segments intersect each other javascript
- w3schools angular
- javascript loop through array backwords
- react template
- javascript get url path
- next.js google script
- firebase configuration on functions
- add dev dependency yarn
- how to check if 2 sprites are touching js
- react padding at bottom svg
- movement of objects in javascript
- js set visibility on timeout
- factory function javascript
- How can I check whether a variable is defined in Node Js