Skip to content

Commit

Permalink
refac(react): useLocalStorage/SessionStorage setState 함수 타입 변경 (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 authored Nov 17, 2024
1 parent 93652e9 commit 28d3035
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-horses-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-kit/react': patch
---

refac(react): useLocalStorage/SessionStorage setState 함수 타입 변경 - @ssi02014
21 changes: 5 additions & 16 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
7 changes: 4 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"license": "MIT",
"devDependencies": {
"@modern-kit/types": "workspace:*",
"@modern-kit/utils": "workspace:*",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
Expand All @@ -39,7 +38,6 @@
"@types/lodash-es": "^4",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/ua-parser-js": "^0.7.39",
"@vitest/coverage-istanbul": "^2.1.3",
"classnames": "^2.5.1",
"esbuild": "^0.24.0",
Expand All @@ -55,9 +53,12 @@
"tslib": "^2.6.1",
"typescript": "^5.1.6",
"typescript-plugin-css-modules": "^5.1.0",
"ua-parser-js": "^1.0.38",
"vitest": "^2.1.3"
},
"dependencies": {
"@modern-kit/utils": "workspace:^",
"ua-parser-js": "^1.0.39"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useLocalStorage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function useLocalStorage<T>(props: UseLocalStorageProps<T>) {
}, [externalStoreState, initialValueToUse]);

const setState = useCallback(
(value: Dispatch<SetStateAction<T | null>>) => {
(value: SetStateAction<T | null>) => {
try {
const prevStateString = getSnapshot(key);
const prevState = prevStateString
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useSessionStorage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function useSessionStorage<T>(props: UseSessionStorageProps<T>) {
}, [externalStoreState, initialValueToUse]);

const setState = useCallback(
(value: Dispatch<SetStateAction<T | null>>) => {
(value: SetStateAction<T | null>) => {
try {
const prevStateString = getSnapshot(key);
const prevState = prevStateString
Expand Down
24 changes: 9 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4956,7 +4956,7 @@ __metadata:
resolution: "@modern-kit/react@workspace:packages/react"
dependencies:
"@modern-kit/types": "workspace:*"
"@modern-kit/utils": "workspace:*"
"@modern-kit/utils": "workspace:^"
"@rollup/plugin-commonjs": "npm:^28.0.0"
"@rollup/plugin-node-resolve": "npm:^15.1.0"
"@rollup/plugin-terser": "npm:^0.4.3"
Expand All @@ -4968,7 +4968,6 @@ __metadata:
"@types/lodash-es": "npm:^4"
"@types/react": "npm:^18.2.20"
"@types/react-dom": "npm:^18.2.7"
"@types/ua-parser-js": "npm:^0.7.39"
"@vitest/coverage-istanbul": "npm:^2.1.3"
classnames: "npm:^2.5.1"
esbuild: "npm:^0.24.0"
Expand All @@ -4984,7 +4983,7 @@ __metadata:
tslib: "npm:^2.6.1"
typescript: "npm:^5.1.6"
typescript-plugin-css-modules: "npm:^5.1.0"
ua-parser-js: "npm:^1.0.38"
ua-parser-js: "npm:^1.0.39"
vitest: "npm:^2.1.3"
peerDependencies:
react: ^18.0.0
Expand All @@ -5002,7 +5001,7 @@ __metadata:
languageName: unknown
linkType: soft

"@modern-kit/utils@workspace:*, @modern-kit/utils@workspace:packages/utils":
"@modern-kit/utils@workspace:^, @modern-kit/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@modern-kit/utils@workspace:packages/utils"
dependencies:
Expand Down Expand Up @@ -6645,13 +6644,6 @@ __metadata:
languageName: node
linkType: hard

"@types/ua-parser-js@npm:^0.7.39":
version: 0.7.39
resolution: "@types/ua-parser-js@npm:0.7.39"
checksum: fea522f42dfc2854d9c93144a13c3db3bbe1c791458451db06d46bec7e1dbbe945d1542e02bb38378e39a04bdb7810b43e2ead26f9e6c250832e187312522708
languageName: node
linkType: hard

"@types/unist@npm:*, @types/unist@npm:^3.0.0":
version: 3.0.2
resolution: "@types/unist@npm:3.0.2"
Expand Down Expand Up @@ -21794,10 +21786,12 @@ __metadata:
languageName: node
linkType: hard

"ua-parser-js@npm:^1.0.38":
version: 1.0.38
resolution: "ua-parser-js@npm:1.0.38"
checksum: b1dd11b87e1784c79f7129e9aec679753fccf8a9b22f5202b79b19492635b5b46b779607a3cfae0270999a0d48da223bf94015642d2abee69d83c9069ab37bd0
"ua-parser-js@npm:^1.0.39":
version: 1.0.39
resolution: "ua-parser-js@npm:1.0.39"
bin:
ua-parser-js: script/cli.js
checksum: c6452b0c683000f10975cb0a7e74cb1119ea95d4522ae85f396fa53b0b17884358a24ffdd86a66030c6b2981bdc502109a618c79fdaa217ee9032c9e46fcc78a
languageName: node
linkType: hard

Expand Down

0 comments on commit 28d3035

Please sign in to comment.