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 2 months ago
JSON representation

Convert Svelte component to Vue or React component, with SSR support.

Lists

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)