If it is implemented well, it won't hurt SEO.
When all URL changes are done
onclick it might be tempting to no longer using
<a href links in your pages. However, doing that would make your pages uncrawlable. To implement the feature while supporting search engine crawlers your links would have to look like normal links in the source code but have an on-click that changes the page and prevents the default navigation. Something like:
<a href="/foo.html" onclick="showfoo(); return false;">Foo</a>
showfoo would load the correct content into the page and using
History.pushState() to change the URL for the user without fully loading the new page. The
return false; prevents the browser from handling the
href on its own.
You would also need to make sure that if you type
http://example.com/foo.html into your browser, the correct page and content loads. Even when users don't navigate to that URL from within your website, you need to support search engine visitors that come into that URL directly.
However, even for Googlebot there are some gotchas:
- Indexing and updates take way longer. Google may take a few weeks extra to process your page and include it in the search index.
- Googlebot doesn't click anything, scroll the page, move the mouse, or otherwise interact with the page. The only content that Googlebot sees is the content that shows up when the page is loaded. Any content that appears only after user interaction will be ignored.