How to integrate jquery-ui with React?

Asked

Viewed 106 times

0

I am doubtful... I would like to integrate the jquery-ui with React... I am creating a calculator and do not know how to make it move on the screen.

I’m trying to collaborate with free software and I don’t know much...

I took this official code from the documentation

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>jQuery UI Draggable - Default functionality</title>
        <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
        <link rel="stylesheet" href="/resources/demos/style.css">
        <style>
            #draggable { width: 150px; height: 150px; padding: 0.5em; }
        </style>
        <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
        <script>
            $(function () {
                $("#draggable").draggable();
            });
        </script>
    </head>
    <body>
        <div id="draggable" class="ui-widget-content">
            <p>Drag me around</p>
        </div>
    </body>
</html>
<script>
$(function() {
    $("#draggable").draggable();
});
</script>

The calculator is

https://codepen.io/fabiozinid/pen/BoOGPN

Links

https://jqueryui.com/draggable/

https://reactjs.org/

  • 1

    The right question is why integrate jQuery with React? Especially if it’s only because of 1 animation

  • 1

    As @Costamilam commented, you should think about using both, you know exactly what they both do? so is just "sewing" your code, joining parts, it would be simpler to search for a plugin that makes the drag and drop for React without jquery

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.