I am thinking to use axios and not fetch because of the below ease of use
axios.post(url,data,auth).then(res => {
toast("Successful!");
})
.catch(err => {
toast(<pre style={{whiteSpace: 'pre-line' }}>Error!<br></br>{JSON.stringify(err.response['data'])}</pre>);
});
Main advantage:
but in the fetch it not so easy to do this.
But i found many projects people use fetch inspite the difficulty. But i want to stick to axios. Will i have to worry about this
Axios is popular library so you shouldn't to worry about using this. Axios have many advantage on fetch. For example, I like instances in axios. Here is list of the advantages and differences.