I'm trying to create a method inside the redux-saga to charm the toast so as to display on the screen. That is, the script so far looks like this:
import { Toast } from 'native-base';
export function* message() {
// const { type, txt, position } = action;
yield put(Toast.show({
text: 'Informe seu usuário e senha',
position: 'top',
type: 'danger',
}));
}
export function* checkLogin(action) {
try {
const response = yield call(
api.post, '/v1/usuario/autenticar',
{
usuario_login: action.payload.usuario,
usuario_senha: action.payload.senha,
},
);
yield put(LoginActions.checkLoginSuccess(response.data));
yield put(NavigationActions.reset({ index: 0, actions: [NavigationActions.navigate({ routeName: 'Main' })] }));
} catch (e) {
yield put(LoginActions.checkLoginFailure());
yield put(message);
}
}
My login screen has the Root tag involving everything else as it is the default for Toast use but I still can not use it.