Не совсем понятно, что вы подразумеваете под предварительным рендерингом.
Под предварительной загрузкой вы подразумеваете, что хотите, чтобы компонент рендерился только тогда, когда изображение готово?
Если это так, вы могли бы сделать что-то вроде этого:
componentDidMount() {
const img = new Image();
img.src = Newman; // by setting an src, you trigger browser download
img.onload = () => {
// when it finishes loading, update the component state
this.setState({ imageIsReady: true });
}
}
render() {
const { imageIsReady } = this.state;
if (!imageIsReady) {
return <div>Loading image...</div>; // or just return null if you want nothing to be rendered.
} else {
return <img src={Newman} /> // along with your error message here
}
}