I'm trying to creat a login with react and firebase. I've been following a tutorial, the problem is that this code:
const handleLogin = useCallback(
async event => {
event.preventDefault();
const { email, password } = event.target.elements;
try {
await firebaseConfig.auth().signInWithEmailAndPassword(email.value, password.value);
history.push("/citas")
} catch (error) {
alert(error);
}
},
[history]
);
is giving me this error:
ReferenceError: Can't find variable: regeneratorRuntime
I don't find any solution as I don't know what it means. Any ideas?
Using @babel/polyfill is officially deprecated. Since you are using a react application (and do not rely on a legacy codebase) you could prefer using the following:
npm i --save core-js/stable regenerator-runtime
// ECMA Script Polyfills:
import "core-js/stable";
// Needed for the generator functions which are transpiled from your async await keywords
import "regenerator-runtime/runtime";
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With