Skip to content

Commit

Permalink
Fix useCookie doesn't support options on remove
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeDuncko authored Sep 18, 2020
1 parent 6cde353 commit 5e31131
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/useCookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const useCookie = (
[cookieName]
);

const deleteCookie = useCallback(() => {
Cookies.remove(cookieName);
setValue(null);
const deleteCookie = useCallback(
(options?: Cookies.CookieAttributes) => {
Cookies.remove(cookieName, options);
setValue(null);
}, [cookieName]);

return [value, updateCookie, deleteCookie];
Expand Down

0 comments on commit 5e31131

Please sign in to comment.