我想使用firebase auth with native for Login,Signup但是我得到了一个黄色错误:
长时间(即多分钟)设置计时器是Android上的性能和正确性问题,因为它使计时器模块保持唤醒状态,并且只有在应用程序位于前台时才能调用计时器.有关详细信息,请参阅(https://github.com/facebook/react-native/issues/12981).(看到setTimeout,持续时间为111862ms)
我该如何解决这个问题?
我不想忽视这一点,我想理解这个错误并用最好的标准方式解决这个问题.
这是我的代码:
export default class Login extends Component {
constructor(props) {
super(props)
this.state = {
email: '',
password: '',
response: ''
}
this.signUp = this.signUp.bind(this)
this.login = this.login.bind(this)
}
async signUp() {
try {
await firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)
this.setState({
response: 'Account Created!'
})
setTimeout(() => {
this.props.navigator.push({
id: 'App'
})
}, 1500)
} catch (error) {
this.setState({
response: error.toString()
})
}
}
async login() {
try {
await …Run Code Online (Sandbox Code Playgroud)