jQuery UI Widgets Forums React Basic React integration

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 7 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Basic React integration #100364

    iLoveJQWidgets
    Participant

    I am trying to follow the demos but I am getting an error when trying to import a module. I am strictly coding using .jsx files (not .js!!)

    When I try following this example I get an error with the first three import lines:

    https://www.jqwidgets.com/react/react-treegrid/react-treegrid-defaultfunctionality.htm

    ex:

    import JqxTreeGrid from ‘../../../jqwidgets-react/react_jqxtreegrid.js’;

    In my browser it is a .js file that was converted from .jsx, but I get a “require” error because the browser can’t interpret this without using Browserify, Require JS etc.

    But if I take out those import lines, I can’t use the JqxTreeGrid module in the snippet below

    <JqxTreeGrid ref='myTreeGrid'
                    width={850} source={dataAdapter} pageable={true}
                    columnsResize={true} columns={columns}
                  />

    Error when I include import… in the .jsx file:

    Uncaught ReferenceError: require is not defined

    When I do not include the import… in the .jsx file:

    Uncaught ReferenceError: JqxTreeGrid is not defined

    Is there a way to use React with jqWidgets using .jsx files without having to install something like Browserify?

    Basic React integration #100386

    Martin
    Participant

    Hello iLoveJQWidgets,

    Unfortunately, we have not tested this for the moment.
    I’m sorry for not being useful.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.