Within my application, my goal is to verify the existence of a token for the current user and then redirect them accordingly. The code I have written for this task is outlined below:
componentDidMount() {
SecureStore.getItemAsync('token').then((val) => {
val ? Actions.link() : null
}
).then(this.setState({ loaded: true }))
}
Despite logging the value in the console and confirming that it does exist, the function Actions.link() is never executed.
I am seeking guidance on how to accurately determine the presence or absence of a variable.