From a603d2cb92bde30ebed0451770aa9d7e19c5aebe Mon Sep 17 00:00:00 2001
From: Ethan Niser <100045248+ethanniser@users.noreply.github.com>
Date: Tue, 14 Mar 2023 14:41:02 +0000
Subject: [PATCH] minor changes
---
.changeset/funny-ways-grow.md | 5 +++++
README.md | 7 +++----
src/cli.ts | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
create mode 100644 .changeset/funny-ways-grow.md
diff --git a/.changeset/funny-ways-grow.md b/.changeset/funny-ways-grow.md
new file mode 100644
index 0000000..aa2b1fa
--- /dev/null
+++ b/.changeset/funny-ways-grow.md
@@ -0,0 +1,5 @@
+---
+"next-typesafe-url": patch
+---
+
+minor edits to docs, and change to the cli message after generating types
diff --git a/README.md b/README.md
index a845264..f4c28d9 100644
--- a/README.md
+++ b/README.md
@@ -170,10 +170,9 @@ const { data, isValid, isReady, isError, error } = params;
if (!isReady) {
return
loading...
;
-} else if (isError) {
+} else if (isError && isReady) {
return Invalid search params {error.message}
;
-} else {
- // isValid === true
+} else if (isValid){
return {data.userInfo.name}
;
}
```
@@ -186,7 +185,7 @@ _For convenience, instead of needing checking `isReady && !isError`, I have adde
## Reccomended Usage
-**It is reccomended to only call `useSearchParams` and `useRouteParams` in the top level component of each route, and pass the data down to child components through props or context.**
+**It is HIGHLY reccomended to only call `useSearchParams` and `useRouteParams` in the top level component of each route, and pass the data down to child components through props or context.**
If you are looking for a easier way to do globally this check out [Jotai](https://jotai.org/).
diff --git a/src/cli.ts b/src/cli.ts
index f1d0fdf..071e09e 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -27,7 +27,7 @@ function build() {
getRoutesWithExportedRoute(pagesPath, pagesPath);
generateTypesFile(exportedRoutes, filesWithoutExportedRoutes);
- console.log("Generated types.d.ts");
+ console.log("Generated route types");
}
function watch() {
@@ -36,7 +36,7 @@ function watch() {
.on("change", () => {
build();
});
- console.log("Watching for routes changes...");
+ console.log("Watching for route file changes...");
}
if (require.main === module) {