Anyone use DataTables with ReactJS?

Anyone use DataTables with ReactJS?

jLinuxjLinux Posts: 981Questions: 73Answers: 75

I plan on starting my next peoject soon, which im planning on using ReactJS, which im very new to. I know React uses a virtual DOM, and ive heard some things regarding issues with React and jQuery plugins, since jQuery plays entirely in the DOM.

So i was wondering is anyone has had any issues using DataTables inaide a ReactJS application?

Thanks!!

Answers

  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin

    Not something I've tried myself, but interested to hear how you get on with it if you do try it. I'm not sure how well they will play together since DataTables is trying to handle the DOM itself - it might be that they just can't be used on the same table, but they could sit side by side on the same page.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited December 2015

    So from my research, it looks like its near impossible to get it to work perfectly. You can get DT to display and work ok, but when you do anything else with React, react basically goes back to using its own virtual DOM, which I think would mess with the DT.

    I found this "fix", but notice he has to use destroy to get it to work

    How about angular? I think it might work ok with AngularJS... Heres my template, using AngularJS, and DataTables

    Edit: Found this regarding AngularJS + DT

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    FYI, I decided to scratch using both AngularJS and ReactJS, since the both aren't too friendly with other libraries, especially ones that play in the DOM a lot (EG: DataTables)

    Solution?... BackboneJS & MarionetteJS

    Seems to fit every requirement I need:

    • Stable/Fast Framework
    • SPA Web App interfacing with RESTful API
    • Supports other JS Libraries (jQuery)

    Ive heard of BackboneJS, and looked into it (It wasn't a good fit for the project I was working on at the time), but I've never heard of MarionetteJS.. Its a framework for BackboneJS (A framework for a framework? lol)

    But from what I can tell, I think itll be perfect for our needs

This discussion has been closed.