Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jquery selectors to render reactjs

I am using jquery for ajax in the build of a test app whilst learning react.

Is it possible to use to jquery selector as the target to render react components?

This is from the react tut.:

React.render(
    <FilterableProductTable products={PRODUCTS} />,
    document.getElementById('content')
);

This does not work but i don't even know if it is possible:

React.render(
    <FilterableProductTable products={PRODUCTS} />,
    $('#content')
);

Thanks, John

like image 571
John Avatar asked Apr 04 '15 13:04

John


1 Answers

This will do the trick

React.render(
    <FilterableProductTable products={PRODUCTS} />,
    $('#content')[0]
);
like image 98
Rise Ledger Avatar answered Oct 27 '22 05:10

Rise Ledger