File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,17 @@ export type ParserBuilder<T> = Required<Parser<T>> &
42
42
43
43
/**
44
44
* Specifying a default value makes the hook state non-nullable when the
45
- * query is missing from the URL.
45
+ * query is missing from the URL: the default value is returned instead
46
+ * of `null`.
46
47
*
47
- * Note: if you wish to specify options as well, you need to call
48
- * `withOptions` **before** `withDefault`.
48
+ * Setting the state to the default value¹ will clear the query string key
49
+ * from the URL, unless `clearOnDefault` is set to `false`.
50
+ *
51
+ * Setting the state to `null` will always clear the query string key
52
+ * from the URL, and return the default value.
53
+ *
54
+ * ¹: Equality is checked with the parser's `eq` function, or referential
55
+ * equality if not provided.
49
56
*
50
57
* @param defaultValue
51
58
*/
You can’t perform that action at this time.
0 commit comments