Narasimha
Sr. Corporate Trainer, Mentor
Narasimha
Sr. Corporate Trainer, Mentor
Week5 – React JS
Day21 : Introduction, Components
Day22 : State, Events, Apply Styles
Day23 : Remote Server Calls, Form Validations
Day24 : Routing and Redux, React Hooks
Day25 : Testing
Narasimha
Sr. IT Trainer/Consultant
Narasimha
Sr. IT Trainer/Consultant
Server Calls - AJAX
• AJAX is client side programming technique to exchange
data between client and server
• We can implement AJAX calls in React in the following
ways:
– window.fetch() method
– axios library
Axios Package
• Axios is a lightweight HTTP client based library
• It helps us to communicate with server.
• Installation:
• npm install --save axios
JSON Server
.NET
Oracle
React JSON Java
MySql
PHP
APP Python Sql Server
Node / Express MongoDb
Client Server Database
Axios Package - Usage
import axios from 'axios';
axios.get(url).then(resData =>
{
// process the resData
});
Axios Methods for CRUD
CREATE : axios.get(url).then();
READ : axios.post(url, data).then();
UPDATE : axios.put(url, data).then();
DELETE : axios.delete(url).then();
Hands-On Implementation
Practice Hands-Ons