Skip to content

Commit 37a9605

Browse files
committed
fix: Deprecated: element.ref
1 parent 23f44f3 commit 37a9605

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/fluffy-pumas-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@craftjs/utils': patch
3+
---
4+
5+
Accessing element.ref is no longer supported. ref is now a regular prop.

packages/utils/src/EventHandlers/wrapConnectorHooks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function cloneWithRef(
1919
element: any,
2020
newRef: any
2121
): React.ReactElement<any> {
22-
const previousRef = element.ref;
22+
const previousRef = element.props.ref;
2323
invariant(
2424
typeof previousRef !== 'string',
2525
'Cannot connect to an element with an existing string ref. ' +

0 commit comments

Comments
 (0)