com.facebook.react.bridge.readablenativemap 在 React Native 中无法转换为 java.lang.string

com.facebook.react.bridge.readablenativemap cannot be cast to java.lang.string in React Native

我正在使用 React native 和 Redux-saga。当我尝试将 value saga true 传递到我的后端时......我收到了这样的错误消息。而且我已经在 Whosebug 中尝试过相同的问题答案,但是这个答案对我不起作用。我是学生,所以我不知道更多。如果有人能帮我解决这个问题,我真的很感激你们。❤️

function addUserPassMailChild(email, password) {
    auth()
        .createUserWithEmailAndPassword(email, password)
        .then(() => {
            console.log('User account created & signed in!');
        })
        .catch(error => {
            if (error.code === 'auth/email-already-in-use') {
                console.log('That email address is already in use!');
            }

            if (error.code === 'auth/invalid-email') {
                console.log('That email address is invalid!');
            }

            console.error(error);
        });
}

export function* addUserPassMail(action) {
    const email = action.payload.email;
    const password =action.payload.password;
    console.log(email, password)

    try {
        const emailLogin = yield call(addUserPassMailChild, {email:email, password:password})

        if (emailLogin) {
            // console.log(loginData.additionalUserInfo.profile)
            yield put(AddUserSuccess(emailLogin))
            yield put({
                type: GET_USER_TOKEN_LISTENER,
            })
        }
    } catch (error) {
        console.log(error)
        yield put(AddUserField(error))
    }
}

尝试像这样传递参数:

yield call(addUserPassMailChild, email, password);

或者尝试这样获取参数:

function addUserPassMailChild({email, password}) {
// TODO
}