@unsetsoft/ryunixjs 1.2.4-canary.11 → 1.2.4-canary.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1044,10 +1044,7 @@ const createContext = (
1044
1044
  const useQuery = () => {
1045
1045
  if (typeof window === 'undefined') return {}
1046
1046
 
1047
- const ctx = RouterContext.useContext('ryunix.navigation');
1048
- const searchStr = ctx && ctx.location ? (ctx.location.split('?')[1]?.split('#')[0] || '') : window.location.search;
1049
-
1050
- const searchParams = new URLSearchParams(searchStr || window.location.search);
1047
+ const searchParams = new URLSearchParams(window.location.search);
1051
1048
  const query = {};
1052
1049
  for (const [key, value] of searchParams.entries()) {
1053
1050
  query[key] = value;
@@ -1066,12 +1063,6 @@ const useQuery = () => {
1066
1063
  const useHash = () => {
1067
1064
  if (typeof window === 'undefined') return ''
1068
1065
 
1069
- const ctx = RouterContext.useContext('ryunix.navigation');
1070
- if (ctx && ctx.location) {
1071
- const parts = ctx.location.split('#');
1072
- return parts.length > 1 ? `#${parts[1]}` : ''
1073
- }
1074
-
1075
1066
  const [hash, setHash] = useStore(window.location.hash);
1076
1067
  useEffect(() => {
1077
1068
  const onHashChange = () => setHash(window.location.hash);
@@ -1198,10 +1189,10 @@ const findRoute = (routes, path) => {
1198
1189
  * `value` prop set to `contextValue`, and wrapping the `children` within a `Fragment`.
1199
1190
  */
1200
1191
  const RouterProvider = ({ routes, children }) => {
1201
- const [location, setLocation] = useStore(window.location.pathname + window.location.search + window.location.hash);
1192
+ const [location, setLocation] = useStore(window.location.pathname);
1202
1193
 
1203
1194
  useEffect(() => {
1204
- const update = () => setLocation(window.location.pathname + window.location.search + window.location.hash);
1195
+ const update = () => setLocation(window.location.pathname);
1205
1196
  window.addEventListener('popstate', update);
1206
1197
  window.addEventListener('hashchange', update);
1207
1198
  return () => {