Fork me on GitHub
#clojurescript
<
2022-07-31
>
teodorlu11:07:07

Beginner question -- how do I call to jquery from Clojurescript? I want to run this (https://datatables.net/):

$('#myTable').DataTable();
Does this look right?
(.DataTable (js/$ "#example"))

teodorlu11:07:49

I'm doing something wrong. Here's what I got: https://play.teod.eu/scicloj-libraries/#fancy I'm trying to load the second table as a JQuery data table. But I'm also using Reagent to generate the DOM, which might be a bad idea. (https://github.com/teodorlu/play.teod.eu/tree/2d2d8631bcb67fce6197b0c74a39266bc5bc02ff/scicloj-libraries/libs.cljs)

thheller11:07:19

it is valid on its own yes, but entirely different when used with reagent/react

👍 1
✔️ 1
thheller12:08:12

kinda hard to say since I don't have a clue what you are doing 🙂

😄 1
thheller12:08:47

but generally yes, when using react its best to stay in the react ecosystem and not use jquery

👍 1