preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.02k stars 155 forks source link

Link middle-click #374

Closed bturner1273 closed 4 years ago

bturner1273 commented 4 years ago

So default behavior for an anchor/link on a middle click is to open a new tab at the link href. However, the server I am using to handle serving the preact page has no concept of the preact-router routes and (obviously) errors out on the new tab.

Is there a way that people usually handle this or is this an issue?

Kanaye commented 4 years ago

You 'll need to either: Use somesing like SSR so your server can handle the urls. Or return the entry-html with your preact router for all URLs Serverside. Otherwise things like users reloading the page (or restarting their browser) will also see 404s