DEV Community

Discussion on: 5 tips to improve your React and JS code

Collapse
 
sunnie profile image
sunnie

Hello,In #5 API.js
export const fetchUser = async (errorHandler) => {
try {
const user = await axios.get('/user/25')
} catch(error) {
errorHandler(error)
}
}

Is there need to return ‘user ’?