Search code examples
jquerycxjs

cxjs What is the best way to build a cxjs widget from a jquery plugin?


I would like to migrate an older jquery app that uses jquery d3 charts. what is the best way to wrap jquery $ components in cxjs widgets?

I wasn't able to adapt https://reactjs.org/docs/integrating-with-other-libraries.html and found no other option yet..

Thanks


Solution

  • Okay.. helped myself this time :-)

    load jquery and dependencies in the html file and see above react integration example.

    To get the react VDOM into cx you need to import:

    import React from 'react';
    import { VDOM } from "cx-react";
    import { findDOMNode } from "react-dom";