-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
Describe The Problem To Be Solved
on the server getRequestEvent() has Request.url but its not a convenient URL object, and on the client we have location which is not exactly the same as URL
Suggest A Solution
import { getRequestEvent, isServer } from "solid-js/web";
function useUrl() {
return new URL(isServer ? getRequestEvent()!.request.url : location.href);
}should this be added? just a suggestion!
Metadata
Metadata
Assignees
Labels
No labels