hooks icon indicating copy to clipboard operation
hooks copied to clipboard

useCookieState: Missing option types

Open Snazzie opened this issue 1 year ago • 2 comments

it looks like Option only has defaultValue.

React: 18.2.0 Typescript: 5.3.3

  const [_, setToken] = useCookieState("token", {
    defaultValue: "",
    secure:true  // Error: Object literal may only specify known properties, and 'secure' does not exist in type 'Options'.ts(2353)
  });

also setToken.newOptions is not typed

Code_siMHyrmq28 Code_eBEUI0XqwF

Snazzie avatar Jan 31 '24 03:01 Snazzie

I have no problem here, please provide an example. @Snazzie

image

crazylxr avatar Feb 26 '24 01:02 crazylxr

Hello @Snazzie. Please provide a online reproduction by forking this link https://codesandbox.io/s/ok2fe or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @Snazzie, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

github-actions[bot] avatar Feb 26 '24 01:02 github-actions[bot]