use-svelte-hook

0.0.1 • Public • Published

useSvelte

A React hook for loading Svelte modules.

Example

Pass some Svelte code to useSvelte(), and it returns a ref suitable for binding an element.

import { useSvelte } from 'use-svelte'

function App() {
  const ref = useSvelte(`<p>{123}</p>`)

  return (
    <main>
      <h1>Svelte App</h1>
      <div ref={ref}/>
    </main>
  )
}

export default App

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i use-svelte-hook

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

2.49 kB

Total Files

3

Last publish

Collaborators

  • joshnuss