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) {