Skip to content

Commit

Permalink
Merge pull request #1391 from creative-commoners/pulls/2/replacement-…
Browse files Browse the repository at this point in the history
…find-dom-node

MNT Replace deprcated function findDOMNode
  • Loading branch information
GuySartorelli authored Aug 29, 2023
2 parents 959966b + f1db6de commit 16022fc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions client/dist/js/TinyMCE_sslink-file.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/dist/js/TinyMCE_ssmedia.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions client/src/components/AssetDropzone/AssetDropzone.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global FileReader, Image, document, FormData */
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import i18n from 'i18n';
import DropzoneLib from 'dropzone';
import $ from 'jquery';
Expand Down Expand Up @@ -33,7 +32,7 @@ class AssetDropzone extends Component {

componentDidMount() {
this.dropzone = new DropzoneLib(
ReactDOM.findDOMNode(this),
this.dropzoneRef,
Object.assign({},
this.getDefaultOptions(),
this.props.options
Expand Down Expand Up @@ -92,7 +91,7 @@ class AssetDropzone extends Component {
}

if (uploadSelector) {
const found = $(ReactDOM.findDOMNode(this)).find(uploadSelector);
const found = $(this.dropzoneRef).find(uploadSelector);
if (found && found.length) {
clickable = found.toArray();
}
Expand Down Expand Up @@ -268,7 +267,7 @@ class AssetDropzone extends Component {
* @param {Event} event
*/
handleDragLeave(event) {
const componentNode = ReactDOM.findDOMNode(this);
const componentNode = this.dropzoneRef;

if (!this.props.canUpload) {
return;
Expand Down Expand Up @@ -552,7 +551,7 @@ class AssetDropzone extends Component {
}

return (
<div className={className.join(' ')}>
<div className={className.join(' ')} ref={node => { this.dropzoneRef = node; }}>
{this.props.uploadButton &&
<button {...buttonProps}>
{i18n._t('AssetAdmin.DROPZONE_UPLOAD')}
Expand Down
3 changes: 1 addition & 2 deletions client/src/containers/Gallery/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import $ from 'jquery';
import i18n from 'i18n';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import { bindActionCreators, compose } from 'redux';
import AssetDropzone from 'components/AssetDropzone/AssetDropzone';
Expand Down Expand Up @@ -109,7 +108,7 @@ class Gallery extends Component {
* @returns {jQuery}
*/
getSortElement() {
return $(ReactDOM.findDOMNode(this)).find('.gallery__sort .dropdown');
return $(this.gallery).find('.gallery__sort .dropdown');
}

/**
Expand Down

0 comments on commit 16022fc

Please sign in to comment.