简体   繁体   中英

Using React.js and Vue.js Together in Laravel

I really want to know, is it possible to using react.js and vue.js next to each other in a laravel?
For Example, use ReactJs for admin dashboard and use VueJs for client dashboard. I know it's technically and logically better to use one of them.
What do you think? Can we use them together?

Yes. It is definitely possible. Polyglot programming is today's reality. There are a couple of approaches you can take. A most common approach would be that of a micro-frontends .

How you implement micro-frontend is up to you! But in general, you will have two different SPA served on two different routes. You will interlink these two applications using hyperlinks/anchor tags. However, note that, doing something that is a big cost and really meant for very large applications and teams building them.

There are many leaf components like buttons, links, dropdown, etc. which you will end up developing and maintaining for both frameworks. State management, routing, services will be rewritten for each framework. It is incredibly painful to match consistent style guide across frameworks.

Nowadays, if you really need to go ahead with this approach, you can consider using custom-elements for your leaf components. They should work for many SPA frameworks (see the notes). This will help you save the trouble of reinventing the wheel.

Note: React is not very friendly with web-components. It fails on many advanced tests .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM