{"_id":"@egoist/vue-to-react","_rev":"3857592","name":"@egoist/vue-to-react","description":"Turn a Vue component into a React component.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"time":{"modified":"2025-09-01T00:50:19.000Z","created":"2019-07-06T13:26:30.926Z","1.2.0":"2021-07-06T11:40:40.652Z","1.1.0":"2019-07-07T12:06:59.838Z","1.0.1":"2019-07-07T09:09:04.973Z","1.0.0":"2019-07-06T13:26:30.926Z"},"users":{},"author":{"name":"egoist","email":"0x142857@gmail.com"},"repository":{"url":"git+https://github.com/egoist/vue-to-react.git","type":"git"},"versions":{"1.2.0":{"name":"@egoist/vue-to-react","version":"1.2.0","description":"Turn a Vue component into a React component.","main":"dist/index.js","module":"dist/index.mjs","scripts":{"test":"echo lol","build":"rollup -c","prepublishOnly":"npm run build"},"publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/egoist/vue-to-react.git","type":"git"},"author":{"name":"egoist","email":"0x142857@gmail.com"},"license":"MIT","devDependencies":{"@types/react":"^17.0.13","esbuild":"^0.12.15","prettier":"^1.15.2","react":"^16.8.6","react-dom":"^16.8.6","rollup":"^2.52.7","rollup-plugin-dts":"^3.0.2","rollup-plugin-esbuild":"^4.5.0","typescript":"^4.3.5","vite":"^2.4.0","vue":"^2.6.10"},"peerDependencies":{"react":"^16.8.6 || ^17","vue":"^2.6.10 || ^3.0.0"},"gitHead":"e9355e88f8c3e65eb55769518144a2844172f456","bugs":{"url":"https://github.com/egoist/vue-to-react/issues"},"homepage":"https://github.com/egoist/vue-to-react#readme","_id":"@egoist/vue-to-react@1.2.0","_nodeVersion":"16.3.0","_npmVersion":"7.19.1","dist":{"shasum":"ae8dfdadae5a0a14ecc6b44c86ae339bc1622082","size":2974,"noattachment":false,"key":"/@egoist/vue-to-react/-/@egoist/vue-to-react-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@egoist/vue-to-react/download/@egoist/vue-to-react-1.2.0.tgz"},"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-to-react_1.2.0_1625571640341_0.3529497151880796"},"_hasShrinkwrap":false,"publish_time":1625571640652,"_cnpm_publish_time":1625571640652,"_cnpmcore_publish_time":"2021-12-16T11:22:39.457Z"},"1.1.0":{"name":"@egoist/vue-to-react","version":"1.1.0","description":"Turn a Vue component into a React component.","main":"dist/index.js","module":"dist/index.esm.js","scripts":{"test":"npm run lint","build":"bili src/index.js --format esm --format cjs","prepublishOnly":"npm run build","lint":"xo"},"publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/egoist/vue-to-react.git","type":"git"},"author":{"name":"egoist","email":"0x142857@gmail.com"},"license":"MIT","devDependencies":{"bili":"^4.8.0","eslint-config-prettier":"^3.3.0","eslint-config-rem":"^4.0.0","eslint-plugin-prettier":"^3.0.0","eslint-plugin-react":"^7.14.2","husky":"^1.0.0-rc.13","lint-staged":"^7.2.0","poi":"^12.7.0","prettier":"^1.15.2","react":"^16.8.6","react-dom":"^16.8.6","vue":"^2.6.10","xo":"^0.23.0"},"xo":{"extends":["rem","plugin:react/recommended","plugin:prettier/recommended"],"envs":["browser"],"rules":{"react/display-name":"off"}},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix","git add"],"*.{json,md}":["prettier --write","git add"]},"peerDependencies":{"react":"^16.8.6","vue":"^2.6.10"},"gitHead":"f08fbd4eab69efc87ed46e1acbd397be224a0171","bugs":{"url":"https://github.com/egoist/vue-to-react/issues"},"homepage":"https://github.com/egoist/vue-to-react#readme","_id":"@egoist/vue-to-react@1.1.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"shasum":"83c884b8608e8ee62e76c03e91ce9c26063a91ad","size":2792,"noattachment":false,"key":"/@egoist/vue-to-react/-/@egoist/vue-to-react-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@egoist/vue-to-react/download/@egoist/vue-to-react-1.1.0.tgz"},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-to-react_1.1.0_1562501219736_0.5719727948168039"},"_hasShrinkwrap":false,"publish_time":1562501219838,"_cnpm_publish_time":1562501219838,"_cnpmcore_publish_time":"2021-12-16T11:22:39.742Z"},"1.0.1":{"name":"@egoist/vue-to-react","version":"1.0.1","description":"Turn a Vue component into a React component.","main":"dist/index.js","module":"dist/index.esm.js","scripts":{"test":"npm run lint","build":"bili src/index.js --format esm --format cjs","prepublishOnly":"npm run build","lint":"xo"},"publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/egoist/vue-to-react.git","type":"git"},"author":{"name":"egoist","email":"0x142857@gmail.com"},"license":"MIT","devDependencies":{"bili":"^4.8.0","eslint-config-prettier":"^3.3.0","eslint-config-rem":"^4.0.0","eslint-plugin-prettier":"^3.0.0","eslint-plugin-react":"^7.14.2","husky":"^1.0.0-rc.13","lint-staged":"^7.2.0","poi":"^12.7.0","prettier":"^1.15.2","react":"^16.8.6","react-dom":"^16.8.6","vue":"^2.6.10","xo":"^0.23.0"},"xo":{"extends":["rem","plugin:react/recommended","plugin:prettier/recommended"],"envs":["browser"],"rules":{"react/display-name":"off"}},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix","git add"],"*.{json,md}":["prettier --write","git add"]},"peerDependencies":{"react":"^16.8.6","vue":"^2.6.10"},"gitHead":"bca5fc0105eae35dd4803d5cc9e5fa1458cca53b","bugs":{"url":"https://github.com/egoist/vue-to-react/issues"},"homepage":"https://github.com/egoist/vue-to-react#readme","_id":"@egoist/vue-to-react@1.0.1","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"shasum":"f82f0bc4850b25ef23960b90c26af496e76f9170","size":2457,"noattachment":false,"key":"/@egoist/vue-to-react/-/@egoist/vue-to-react-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@egoist/vue-to-react/download/@egoist/vue-to-react-1.0.1.tgz"},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-to-react_1.0.1_1562490544880_0.881572591247187"},"_hasShrinkwrap":false,"publish_time":1562490544973,"_cnpm_publish_time":1562490544973,"_cnpmcore_publish_time":"2021-12-16T11:22:39.962Z"},"1.0.0":{"name":"@egoist/vue-to-react","version":"1.0.0","description":"Turn a Vue component into a React component.","main":"dist/index.js","module":"dist/index.esm.js","scripts":{"test":"npm run lint","build":"bili src/index.js --format esm --format cjs","prepublishOnly":"npm run build","lint":"xo"},"publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/egoist/vue-to-react.git","type":"git"},"author":{"name":"egoist","email":"0x142857@gmail.com"},"license":"MIT","devDependencies":{"bili":"^4.8.0","eslint-config-prettier":"^3.3.0","eslint-config-rem":"^4.0.0","eslint-plugin-prettier":"^3.0.0","eslint-plugin-react":"^7.14.2","husky":"^1.0.0-rc.13","lint-staged":"^7.2.0","poi":"^12.7.0","prettier":"^1.15.2","react":"^16.8.6","react-dom":"^16.8.6","vue":"^2.6.10","xo":"^0.23.0"},"xo":{"extends":["rem","plugin:react/recommended","plugin:prettier/recommended"],"envs":["browser"],"rules":{"react/display-name":"off"}},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["xo --fix","git add"],"*.{json,md}":["prettier --write","git add"]},"peerDependencies":{"react":"^16.8.6","vue":"^2.6.10"},"gitHead":"4125bfcc8c286da954d06298311860871713a2a5","bugs":{"url":"https://github.com/egoist/vue-to-react/issues"},"homepage":"https://github.com/egoist/vue-to-react#readme","_id":"@egoist/vue-to-react@1.0.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"shasum":"3a9496c8f129f06014311ba16e2c9bd85a5fc6f8","size":2455,"noattachment":false,"key":"/@egoist/vue-to-react/-/@egoist/vue-to-react-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@egoist/vue-to-react/download/@egoist/vue-to-react-1.0.0.tgz"},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-to-react_1.0.0_1562419590764_0.02756457179588412"},"_hasShrinkwrap":false,"publish_time":1562419590926,"_cnpm_publish_time":1562419590926,"_cnpmcore_publish_time":"2021-12-16T11:22:40.168Z"}},"readme":"# vue-to-react\n\n[![NPM version](https://badgen.net/npm/v/@egoist/vue-to-react)](https://npmjs.com/package/@egoist/vue-to-react) [![NPM downloads](https://badgen.net/npm/dm/@egoist/vue-to-react)](https://npmjs.com/package/@egoist/vue-to-react) [![CircleCI](https://badgen.net/circleci/github/egoist/vue-to-react/master)](https://circleci.com/gh/egoist/vue-to-react/tree/master) [![donate](https://badgen.net/badge/support%20me/donate/ff69b4)](https://github.com/sponsors/egoist)\n\nThis works for both Vue 2 and Vue 3.\n\n## Install\n\n```bash\nyarn add @egoist/vue-to-react\n```\n\n## Usage\n\n```js\nimport React from 'react'\nimport { render } from 'react-dom'\nimport toReact from '@egoist/vue-to-react'\n\nconst VueComponent = {\n  data() {\n    return {\n      count: 0\n    }\n  },\n\n  render(h) {\n    return h(\n      'button',\n      {\n        on: {\n          click: () => this.count++\n        }\n      },\n      [this.count]\n    )\n  }\n}\n\nconst ReactComponent = toReact(VueComponent)\n\nrender(<ReactComponent />, document.getElementById('app'))\n```\n\n### Passing Props\n\nBy default we pass all props from React to Vue:\n\n```js\nconst Counter = toReact({\n  props: ['initialCount'],\n  render(h) {\n    return h('button', {}, [this.initialCount])\n  }\n})\n\nconst App = <Counter initialCount={0} />\n```\n\nHowever you can customize how the props are passed to Vue with the `passProps` option:\n\n```js\ntoReact(VueComponent, {\n  // Only pass `initialCount` prop\n  passProps: props => ({ initialCount: props.initialCount }),\n  // Or disable props\n  passProps: false\n})\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n**@egoist/vue-to-react** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>\nAuthored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/vue-to-react/contributors)).\n\n> [github.com/egoist](https://github.com/egoist) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@\\_egoistlily](https://twitter.com/_egoistlily)\n","_attachments":{},"homepage":"https://github.com/egoist/vue-to-react#readme","bugs":{"url":"https://github.com/egoist/vue-to-react/issues"},"license":"MIT"}