I am new to React and trying to render an error message when a POST request returns an error. Something like this:

```
$.post({
    url: `/abc/xyz/`,
    cache: false,
    dataType: 'json',
    data: data,
    contentType: 'application/json; charset=utf-8',
    success: function (response) {
        ...
    },
    error: function (response) {    
        ReactDOM.render(
            <div>
                <p>response.statusText</p>
            </div>,
            document.getElementById('errorDialog')
        );
    }
});

```

However, when I try to run it, in the console I keep getting an error:

```
Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.

```

Closer inspection shows the problem to be in the line `ReactDOM.render` inside the error callback. Can this not be used inside the callback? I tried using it outside but possibly due to the async nature of callback functions, it doesn't work. Does someone know how I can fix the problem? Thanks in advance!