File tree Expand file tree Collapse file tree 7 files changed +938
-1004
lines changed
Expand file tree Collapse file tree 7 files changed +938
-1004
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 3535 }
3636 },
3737 "scripts" : {
38+ "dev" : " yarn build && cd ./examples && yarn dev" ,
3839 "build" : " yarn build:core && yarn build:react" ,
3940 "build:core" : " cd ./core && yarn && yarn build" ,
4041 "build:react" : " cd ./react && yarn && yarn build"
6869 "devDependencies" : {
6970 "vite" : " ^5.2.7" ,
7071 "vite-plugin-dts" : " ^3.8.1"
71- }
72+ },
73+ "packageManager" : " yarn@1.22.22"
7274}
Original file line number Diff line number Diff line change @@ -161,15 +161,15 @@ export function useDraggable(config: DraggableConfig) {
161161 ) ;
162162
163163 const draggable = useCallback (
164- ( child : React . ReactElement ) => {
164+ ( child : React . ReactElement < React . ComponentPropsWithRef < any > > ) => {
165165 if ( ! child ) {
166166 return null ;
167167 }
168168
169169 const current = refs . current ;
170170
171- // @ts -ignore
172- current . originalRef = child . ref ;
171+ // @ts -ignore React 16-19+ refs compatibility.
172+ current . originalRef = child . props ?. ref ?? child . ref ;
173173
174174 const clone = React . cloneElement ( child , { ref : componentRef } ) ;
175175
Original file line number Diff line number Diff line change @@ -94,16 +94,19 @@ export function useDroppable(config: DroppableConfig) {
9494 }
9595 } , [ ] ) ;
9696
97- const droppable = useCallback ( ( child : React . ReactElement | null ) => {
98- if ( ! child ) {
99- return null ;
100- }
97+ const droppable = useCallback (
98+ ( child : React . ReactElement < React . ComponentPropsWithRef < any > > | null ) => {
99+ if ( ! child ) {
100+ return null ;
101+ }
101102
102- // @ts -ignore
103- originalRef . current = child . ref ;
103+ // @ts -ignore React 16-19+ refs compatibility.
104+ originalRef . current = child . props ?. ref ?? child . ref ;
104105
105- return React . cloneElement ( child , { ref : dropComponentRef } ) ;
106- } , [ ] ) ;
106+ return React . cloneElement ( child , { ref : dropComponentRef } ) ;
107+ } ,
108+ [ ]
109+ ) ;
107110
108111 return {
109112 droppable,
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "baseUrl" : " ." ,
4+ "lib" : [" ES2015" , " DOM" ],
45 "strict" : true ,
56 "moduleResolution" : " node" ,
67 "sourceMap" : true ,
Original file line number Diff line number Diff line change 22# yarn lockfile v1
33
44
5- " @types/prop-types@* " :
6- version "15.7.12"
7- resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
8- integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==
9-
105" @types/react@>=16.8.0 " :
11- version "18.3.3 "
12- resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3 .tgz#9679020895318b0915d7a3ab004d92d33375c45f "
13- integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw ==
6+ version "19.1.2 "
7+ resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.2 .tgz#11df86f66f188f212c90ecb537327ec68bfd593f "
8+ integrity sha512-oxLPMytKchWGbnQM9O7D67uPa9paTNxO7jVoNMXgkkErULBPhPARCfkKL9ytcIJJRGjbsVwW4ugJzyFFvm/Tiw ==
149 dependencies :
15- " @types/prop-types" " *"
1610 csstype "^3.0.2"
1711
1812csstype@^3.0.2 :
@@ -22,5 +16,3 @@ csstype@^3.0.2:
2216
2317" snapdrag/core@file:../core " :
2418 version "1.0.0"
25- " snapdrag/core@file:../core " :
26- version "1.0.0"
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments