Is it a good idea to mix React and Vue? [closed]

2019-06-04 07:16发布

My company has a dev team in another country and they insist on using Vue for building new modules on top of our existing platform. Our main platform is a single page app built on React with Redux.

Is mixing frameworks based solely on the team's skills a good idea? Is it even feasible to do for these two frameworks?

1条回答
成全新的幸福
2楼-- · 2019-06-04 07:40

If the main reason is "I already know Vue" then I would say no.

If they already know Vue it should be fairly easy to learn react.

I think both frameworks can work together, you can have a small feature in your React app built with Vue because even though your SPA is in React, a Vue component/app can be targeted to any html element and have that to be it's only scope.

This scenario would be a good use case for mixing both frameworks:

Lets say you already have a Vue app that calculates the best way to fill a truck with boxes of different sizes and it's sort of complex in terms of logic and UI, but really isolated from the rest of the logic in your app in that case I think embedding a Vue component/app into your React SPA would be nice because you won't have to build it again.

Example of how the scope of the Vue component is limited:

<div id="app">
  {{ message }}
</div>

var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  }
})

In this case you will have a Vue component that only renders hello world. https://vuejs.org/v2/guide/

查看更多
登录 后发表回答