react-better-html 1.1.69 → 1.1.70

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.
@@ -413,6 +413,10 @@ function useUrlQuery() {
413
413
  if (!reactRouterDomPlugin) {
414
414
  throw new Error("`useUrlQuery` hook requires the `react-router-dom` plugin to be added to the `plugins` prop in `<BetterHtmlProvider>`.");
415
415
  }
416
+ const isInRouterContext = (0, react_router_dom_1.useInRouterContext)();
417
+ if (!isInRouterContext) {
418
+ throw new Error("`useUrlQuery` hook must be used inside a React Router context. Make sure your component is wrapped in a `<BrowserRouter>`, or another Router component.");
419
+ }
416
420
  const navigate = (0, react_router_dom_1.useNavigate)();
417
421
  const [searchParams] = (0, react_router_dom_1.useSearchParams)();
418
422
  const setQuery = (0, react_1.useCallback)((query, keepHistory = true) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-better-html",
3
- "version": "1.1.69",
3
+ "version": "1.1.70",
4
4
  "description": "A component library for react that is as close to plane html as possible",
5
5
  "main": "dist/index.js",
6
6
  "files": [