I am planing to use semantic UI for building a front end, but would like to also use React or Vue for building components. I am wondering how to combine jQuery based frameworks like semantic UI with virtual DOM based ones like React and Vue. The three recommendations I have heard are:
Use a custom integration like semantic react or vue ui. These integrations try to avoid direct DOM manipulation by transforming jQuery logic to component state based logic. They are incomplete, will always run out of sync with the original one and thus depend on constant support.
Use Vue's
mounted
hook as in
export default { mounted() { // jQuery here }, ...}
or React'scomponentDidMount
as in
class App extends React.Component { componentDidMount() { // jQuery here } }
Attach jQuery based logic inside those hooks to the DOM elements. These options seem to work and in many cases of semantic UI effects likedimmer
ortransition
trouble should arise rarely. But it goes against the idea of a virtual DOM as it acts on the DOM directly.Avoid using jQuery altogether and in the case of semantic UI use a CSS only implementation of it. Then build whatever specific effects you need by making the component depend on states, and states only. This seems the best practice for React and Vue but in the case of a simple
transition
ordimmer
effect it seems a bit like re-inventing the wheel. Also this is just a variation of 1. with the only advantage that you are in control of syncing with latest versions & features of semantic UI.
I would like to ask: what advantages & disadvantages of each of the mentioned approaches do you see? What further approaches exist that I have not mentioned?