setError('Enter password and Confirm password.'); return; } else if (password.length < 6) { setError('Password min 6 characters'); return; } else if (password !== confirmPassword) { setError("Passwords don't match."); return; setError(''); resetPassword() .then(async ({ data }) => { }) .catch(err => { setError(err); }); };
setImage(''); setIsFocused(false); setError(''); };
setError(error); return false;
httpClient.interceptors.request.use(req => { setError(null); return req; })
const _onDeleteChart = () => { setChartLoading(deleteModal); removeChart(match.params.projectId, deleteModal) .then(() => { setChartLoading(false); setDeleteModal(false); }) .catch(() => { setChartLoading(false); setError(true); setDeleteModal(false); }); }
//our custom hook const useLocation = () => { const [lat, setLat] = useState(null); const [errorMessage, setError] = useState(''); useEffect(() => { window.navigator.geolocation.getCurrentPosition( position => setLat(position.coords.latitude), err => setError(err.message) ); }, []); return [lat, errorMessage]; }
setError('Enter password and Confirm password.'); return; } else if (password.length < 6) { setError('Password min 6 characters'); return; } else if (password !== confirmPassword) { setError("Passwords don't match."); return; setError(''); resetPassword() .then(async ({ data }) => { }) .catch(err => { setError(err); }); };
setImage(''); setIsFocused(false); setError(''); };
setError(error); return false;