Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development

前端 未结 14 1269
一整个雨季
一整个雨季 2020-12-20 11:08

Everytime I submit a zone, It display this error \'Uncaught Error: A cross-origin error was thrown. React doesn\'t have access to the actual error object in development\' It

14条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 12:02

    If it helps anyone, I had a similar issue trying to call a callback function with part of my state as the argument. My resolution was calling it after a promise for Component Did Mount. Might help someone, even though this isn't an exact solution for your code:

    componentDidMount() {
        const { clientId } = this.props
        axios.get(`/api/getpayments/${clientId}`)
            .then(response => {
                this.setState({ payments: response.data })
            })
            .then(() => {
                this.props.updateProgressBar(this.state.payments.slice())
            })
    }
    

提交回复
热议问题