Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Yes. No. Maybe.
You mean virtual dom?
Does it play well with 3rd parties? React or the virtual dom?
Whatever you're asking, I guess it works well... otherwise it'd be pretty useless, right? -
joas18915yYou can use traditional JS libraries (eg. jQuery plugins) after the component has monted. You can get node instances using refs and pass them to the library you want to use.
Just remember to destroy the library's feature instances (stop timers, undo global listeners, etc.) before unmounting and reinitialize them when recreating nodes the library is interacting with.
This usually applies to all DOM frameworks. -
I might be wrong here so correct me if I'm wrong but:
The virtual dom is a React optimisation for doing a diff between the real dom and the previous dom on React's update cycle. React doesn't refresh anything that it doesn't think has changed for performance.
Third party libraries that change the real dom should still work with React.
There probably is a small performance hit but it depends on how often the third party library updates the dom. -
joas18915y@cmarshall10450 You are most probably right about React's VDOM, but what do you mean by the performance hit? Would the performace be worse then using the library outside of React app / component? React supposedly only updates the nodes it knows belong to it. SSR hydration might be an exception to the rule though.
In react.js?... with react visual-DOM concept, does it fully support and work well with third party libraries ??
question