Vuera is a library designed to enable seamless interoperability between Vue.js and React applications, allowing developers to use Vue components within a React app and vice-versa. It facilitates migration scenarios or the co-existence of both frameworks in a single codebase. The current stable version is 0.2.7. The project appears to have an infrequent release cadence and is currently seeking a new maintainer, indicating a low level of active development. Key differentiators include its dual-framework compatibility and the use of Babel and Vue plugins for simplified integration, abstracting away much of the manual wrapping historically required for such interop solutions. The project's status as 'looking for a maintainer' is a significant factor for potential users.
npm install vueraVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate a React component into a Vue application using Vuera's Vue plugin, including configuring shared Vue instance options.
For Vue < 2.4, wrap all props in a computed property named `passedProps` and bind it to the React component: `<my-react-component :passedProps="computedPropsObject"></my-react-component>`.
Use `import { config } from 'vuera'; config.vueInstanceOptions = { /* your options */ };` to explicitly configure these options globally.Evaluate the stability requirements of your project. Consider alternative interop solutions or be prepared to contribute to maintenance.
Add `vuera/babel` to the `plugins` section of your `.babelrc` or Babel configuration to simplify Vue component usage in React.
Ensure `import { VuePlugin } from 'vuera'; Vue.use(VuePlugin);` is called early in your Vue application setup.Verify that `react`, `react-dom`, and `vue` peer dependencies meet the required versions (`>= 15.2.0` for React/ReactDOM, `>= 2.2` for Vue) and are correctly installed.
Ensure `import { VuePlugin } from 'vuera'; Vue.use(VuePlugin);` is executed in your main Vue app file, and the React component is imported and listed in the `components` option of your Vue component.Ensure `import React from 'react';` is present in your React component files that consume Vue components, even if not explicitly used, as the Babel plugin might rely on it.
Use `import { config } from 'vuera'; config.vueInstanceOptions = { store: myStore, i18n: myI18n };` to pass these options to all wrapped Vue instances.