Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,26 +498,6 @@ class YourComponent extends Component {

If set to `true`, will allow dragging on non left-button clicks.

#### `nodeRef?: React.Ref<typeof React.Component>`

please see, https://github.com/STRML/react-draggable
```
If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
Unfortunately, in order for <Draggable> 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 (
<Rnd nodeRef={nodeRef}>
<div ref={nodeRef}>Example Target</div>
</Rnd>
);
}

```

## Test

``` sh
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ export class Rnd extends React.PureComponent<Props, State> {
cancel={cancel}
scale={scale}
allowAnyClick={allowAnyClick}
nodeRef={nodeRef}
nodeRef={{ current: this.getSelfElement() }}
>
<Resizable
{...resizableProps}
Expand Down