jquery ui - How react works with javascript ui components that modifies html -
most javascript ui components, jquery ui, bootstrap or kendo ui takes html element , renders dynamically.
someting this:
$('#someselect').autocomplete();
i wonder if these frameworks can used react.
let's say, wrap such component react component. when component state changes, e.g. selectedvalue, react rerenders html. since html container javascript ui components renders itself(e.g autocomplete), it's not effective.
can react used javascript ui components or have built react-like rendering in mind
this article "working browser" react documentation discusses this.
using operating on dom directly using jquery not considered practice few reasons:
react intentionally discourages using dom attributes selectors rationale tracing props down through component hierarchy more scalable.
these plugins don't make use of react's event lifecycle. have functionality dependent on dom being mutated, , others regular react components.
still, if necessary can perform operations on dom jquery inside of componentdidmount
.
here's example of using react jquery ui sortable.
Comments
Post a Comment