2

We want to use maquette in an existing system. What's the best practice on making other 3rd party libraries (eg select2, bootstrap tooltip that modifies the DOM in place) play well within maquette?

frank
  • 262
  • 3
  • 9
  • "Maquette is very unopionated by design, making integration with other frameworks and libraries as painless as possible." - [Maquette homepage](https://maquettejs.org/) – Phiter Jan 08 '18 at 19:23
  • This sounds like a question with no single correct answer. StackOverflow is best suited for Q&A style questions, but I think you might be looking to invoke conversation around the topic. Is there a chatroom or a forum or a subreddit for maquette? – cbr Jan 08 '18 at 19:23

1 Answers1

1

Although the question is broad, there is a simple answer. Maquette provides the aftercreate and afterupdate callbacks that can be used to modify the DOM that maquette created/updated. You can use the element argument to invoke the 3rd party library.

Maquette won't mind if the DOM nodes are modified by the 3rd party library. As long as they are not completely removed or replaced it should work fine. There is also the afterremoved callback that can be used to destroy the widget/component/whatever properly.

Johan Gorter
  • 1,253
  • 10
  • 13