import axios from 'axios'; import Config from './Config.js' const apiBase = Config.apiUrlStaging; code example
Example: javascript axios request with params for client side rendering
let params = {
page: currentPage + 1,
per_page: rowsPerPage
}
axios
.get('/products', { params: params })
.then((response) => {
if (isMountedRef.current) {
setProducts(response.data.data);
setMeta(response.data.meta);
}
});