In my React code, I'm trying to convert createClass into ES6 Classes, and I'm struggling here:
componentDidMount()
{
$(ReactDOM.findDOMNode(this)).draggable();
}
(which used to be:
$(this.getDOMNode()).draggable();
before conversion, and worked perfectly)
The error I'm getting is:
__WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.findDOMNode(...).draggable is not a function
I'm aware that draggable() is a function in jQuery UI, so I tried importing that in the script tag of my HTML file.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
I've included the following in my React file:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { findDOMNode } from 'react-dom';
import $ from 'jquery';
import css from './style.css';
Nothing seems to work whatsoever.