Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egoist/svelte-convert
Convert Svelte component to Vue or React component, with SSR support.
https://github.com/egoist/svelte-convert
but-anyways maybe-naive
Last synced: about 1 month ago
JSON representation
Convert Svelte component to Vue or React component, with SSR support.
- Host: GitHub
- URL: https://github.com/egoist/svelte-convert
- Owner: egoist
- License: mit
- Created: 2020-04-25T11:08:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:23:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-23T12:16:33.949Z (about 2 months ago)
- Topics: but-anyways, maybe-naive
- Language: TypeScript
- Homepage:
- Size: 886 KB
- Stars: 78
- Watchers: 4
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - svelte-convert
- awesome-list - svelte-convert
README
# Svelte-Convert
Convert Svelte component to Vue or React component, with SSR support.
## Why
[Svelte](https://svelte.dev) outputs light-weight JavaScript code, so you can use it to write framework agnostic component and then consume it in your React / Vue app.
## Install
```bash
yarn add svelte-convert
```## Usage
### React
```jsx
import { convert } from 'svelte-convert/react'
import SvelteCounter from './Counter.svelte'// Convert the Svelte component to React Component
const Counter = convert(SvelteCounter)export default () => {
return
}
```### Vue
```vue
import { convert } from 'svelte-convert/vue'
import SvelteCounter from './Counter.svelte'export default {
components: {
Counter: convert(SvelteCounter)
}
}```
## Related
You might also like:
- [React to Vue](https://github.com/egoist/react-to-vue)
- [Vue to React](https://github.com/egoist/vue-to-react)## License
MIT © [EGOIST (Kevin Titor)](https://github.com/sponsors/egoist)