@egoist/react-to-vue
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

react-to-vue

NPM version NPM downloads

Install

npm i @egoist/react-to-vue

Usage

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 <button onClick={() => setCount(count + 1)}>{count}</button>
}

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, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily

Readme

Keywords

none

Package Sidebar

Install

npm i @egoist/react-to-vue

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

5.46 kB

Total Files

6

Last publish

Collaborators

  • egoist