From e4ac577a67f5a137c10e3a69b2622e54794521b7 Mon Sep 17 00:00:00 2001 From: Chris Stiles Date: Sun, 26 Jul 2020 17:32:41 -0700 Subject: [PATCH 1/2] Pass resizable ref as nodeRef (#707) --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 9f16aea3..52f4661f 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -626,7 +626,7 @@ export class Rnd extends React.PureComponent { cancel={cancel} scale={scale} allowAnyClick={allowAnyClick} - nodeRef={nodeRef} + nodeRef={{ current: this.getSelfElement() }} > Date: Sun, 26 Jul 2020 17:32:58 -0700 Subject: [PATCH 2/2] Remove nodeRef (#707) --- README.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/README.md b/README.md index 43958383..c3022e28 100755 --- a/README.md +++ b/README.md @@ -498,26 +498,6 @@ class YourComponent extends Component { If set to `true`, will allow dragging on non left-button clicks. -#### `nodeRef?: React.Ref` - -please see, https://github.com/STRML/react-draggable -``` -If running in React Strict mode, ReactDOM.findDOMNode() is deprecated. -Unfortunately, in order for to work properly, we need raw access -to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef` -as in this example: - -function MyComponent() { - const nodeRef = React.useRef(null); - return ( - -
Example Target
-
- ); -} - -``` - ## Test ``` sh