Tagged: React

Nasty React React-Router initialization bug

Over the past few days I've been tracking down a nasty bug in a React application. It's the kind of bug that manifests rarely in development but shows up enough on production that users hate you for it. At first we couldn't reproduce it which means we couldn't fix it. Then by luck and frustration I was typing as quickly as I could to run the 400th test and found that typing a new url really fast caused the browser to reload new content before it was finished loading previous content and boom everything broke. Specifically in this application the login is not handled by React. I would log in and before the browser had a chance to render the resulting page I typed in the url of the React application. This combination was enough to result in a console filled with these errors:

This error shows up once:

Warning: render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rend...

Continue Reading →