Skip to content

Commit

Permalink
MNT Replace deprcated function findDOMNode
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Aug 28, 2023
1 parent 959966b commit db24194
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 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
11 changes: 5 additions & 6 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 Expand Up @@ -321,10 +320,10 @@ class Gallery extends Component {
}

/**
* Handler for when the user changes the sort order
*
* @param {string} value
*/
* Handler for when the user changes the sort order
*
* @param {string} value
*/
handleSort(value) {
this.props.actions.queuedFiles.purgeUploadQueue();
this.props.onSort(value);
Expand Down

0 comments on commit db24194

Please sign in to comment.