Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egoist/react-to-vue
Turn a React component into a Vue component.
https://github.com/egoist/react-to-vue
Last synced: 12 days ago
JSON representation
Turn a React component into a Vue component.
- Host: GitHub
- URL: https://github.com/egoist/react-to-vue
- Owner: egoist
- License: mit
- Created: 2019-07-06T08:34:19.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-30T20:24:07.000Z (about 2 years ago)
- Last Synced: 2024-10-29T15:12:52.512Z (15 days ago)
- Language: TypeScript
- Size: 112 KB
- Stars: 70
- Watchers: 3
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-to-vue
[![NPM version](https://badgen.net/npm/v/@egoist/react-to-vue)](https://npmjs.com/package/@egoist/react-to-vue) [![NPM downloads](https://badgen.net/npm/dm/@egoist/react-to-vue)](https://npmjs.com/package/@egoist/react-to-vue)
## Install
```bash
npm i @egoist/react-to-vue
```## Usage
```js
import { createApp, h } from 'vue'
import React from 'react'
import toVue from '@egoist/react-to-vue'const ReactComponent = () => {
const [count, setCount] = React.useState(0)
return setCount(count + 1)}>{count}
}const VueComponent = toVue(ReactComponent)
createApp({
render: () => h(VueComponent),
}).mount('#app')
```## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**@egoist/react-to-vue** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
Authored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/react-to-vue/contributors)).> [github.com/egoist](https://github.com/egoist) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@\_egoistlily](https://twitter.com/_egoistlily)