Skip to content

Commit fc8e7c6

Browse files
committed
chore: update pkg config
1 parent 770d820 commit fc8e7c6

4 files changed

Lines changed: 48 additions & 7 deletions

File tree

package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,26 @@
2525
"module": "./dist/index.js",
2626
"types": "./dist/index.d.ts",
2727
"exports": {
28-
".": "./dist/index.js",
29-
"./configuration": "./dist/configuration/index.js",
30-
"./react": "./dist/react/index.js",
31-
"./js": "./dist/js/index.js",
32-
"./browser": "./dist/browser/index.js",
28+
".": {
29+
"import": "./dist/index.js",
30+
"types": "./dist/index.d.ts"
31+
},
32+
"./configuration": {
33+
"import": "./dist/configuration/index.js",
34+
"types": "./dist/configuration/index.d.ts"
35+
},
36+
"./react": {
37+
"import": "./dist/react/index.js",
38+
"types": "./dist/react/index.d.ts"
39+
},
40+
"./js": {
41+
"import": "./dist/js/index.js",
42+
"types": "./dist/js/index.d.ts"
43+
},
44+
"./browser": {
45+
"import": "./dist/browser/index.js",
46+
"types": "./dist/browser/index.d.ts"
47+
},
3348
"./package.json": "./package.json"
3449
},
3550
"publishConfig": {
@@ -45,7 +60,9 @@
4560
"devDependencies": {
4661
"@types/lodash-es": "^4.17.12",
4762
"@types/node": "^22.15.17",
63+
"@types/react": "^19.1.9",
4864
"bumpp": "^10.1.0",
65+
"react": "^19.1.1",
4966
"tsdown": "^0.13.1",
5067
"typescript": "^5.8.3",
5168
"vitest": "^3.1.3"

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/react/use-stable.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
export function useStable() {
2-
// TODO
1+
import { useRef } from 'react'
2+
3+
export const useStableFn = <T>(unstableFn: T) => {
4+
const stableFnRef = useRef(unstableFn)
5+
stableFnRef.current = unstableFn
6+
7+
return stableFnRef
38
}

tsdown.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export default defineConfig([
77
dts: true,
88
unbundle: true,
99
treeshake: false,
10+
external: ['react', 'react-dom'],
1011
},
1112
])

0 commit comments

Comments
 (0)