Cannot read property ‘getHostNode’ of null

I was facing a similar issue. It turns out that, in my case, was highlighthjs removing comments from the generated dom.

For text, React 15 is adding comment with the reactid instead of a span tag, as in:

<!-- react-text: 248-->
Another Search
<!--/react-test-->

Can you try something like this?

<Link className="dark button" to="/"><span>Another Search</span></Link>

This will force the generated DOM to include the span with the proper data-reactid attribute.

I would file an issue with react-router, maybe they can do that internally so you would not have to bother about it. But there are challenges with that as the Link child could be basically anything.

Leave a Comment