错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Supporting Other Frameworks

  • Alex Libby

摘要

Now that we have an understanding of the Shadow DOM API and how it operates, it is time to turn our attention to the broader picture – what if we use a framework such as React or Svelte? It presents a challenge, given that not all frameworks use Shadow DOM API by default. All is not lost, though – take, for example, React: with some work, we can use the API without too much difficulty. In this chapter, we’ll explore some of the tricks we can use to reconfigure our sites to allow us to run the Shadow DOM API. We’ll also take a look at a couple of other frameworks to see how they handle using the Shadow DOM, as well as a brief look at performance and some ideas we might consider for future use of the API.