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

标签 javascript reactjs react-native react-redux react-hooks

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

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))
    }
}

enter image description here

最佳答案

尝试像这样传递参数:

yield call(addUserPassMailChild, email, password);

或者尝试获取这样的参数:

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

关于javascript - com.facebook.react.bridge.readnativemap 无法在 React Native 中转换为 java.lang.string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69991991/

相关文章:

JavaScript "\8"文字

react-native - 是否可以在 React Native 中自动重新加载应用程序?

javascript - 组件无法识别它正在导出

javascript - 类型错误 : TypeError: undefined is not an object (evaluating '_this.state.scheduleList' )

javascript - 阻止 UI 交互的元素

javascript - 从 node.js 中的文件流中删除最后一个字符(fs 模块)

javascript - closure-library 在 Pane 之间拖动一个 good.fx.Drag 列表组项

reactjs - 此警告的可能原因和解决方案

reactjs - Typescript `typeof React.Component` 没有扩展接口(interface)?定义高阶组件时遇到问题

javascript - Redux - Saga,放置父函数