In isomorphic rendered page image can be downloaded before main script.js file. So image can be already loaded before react register onLoad>
script.js
react
onLoad>
Another way is to use ref and cover those both scenarios:
{ // onLoad replacement for SSR if (!input) { return; } const img = input; const updateFunc = () => { this.setState({ loaded: true }); }; img.onload = updateFunc; if (img.complete) { updateFunc(); } }} src={imgSrc} alt={imgAlt} />