Can I use multiple frameworks on a single website page?

Viewed 308

Can I use multiple frameworks on a single website page?

I try to use multiple frameworks like Angular, Vue, or React in one website view .. is that good or we can only use one

1 Answers

Yes. It is usually done in big enterprise setting with many separate front-end teams each responsible for a smaller portion of a single web app. Architecting a clean approach for it can be difficult so I recommend that you avoid it if you can. Problems include:

  • How to handle routing such that intra- and inter-framework routes work.
  • How to share state (such as auth tokens) between apps.
  • How to share components (and code in general) between apps.
  • How to avoid importing the same library used by separate frameworks twice.

A popular approach is called micro frontends which mimics the micro service approach for the front end. I’m not aware of any research for how well this works in the wild.

An example (meta) framework that handles this kind of architecture for you is single-spa.

Related