svelte-preprocess-react

Seamlessly use React components inside a Svelte app

MIT License

Downloads
25K
Stars
134
Committers
3
svelte-preprocess-react - 1.0.0

Published by bfanger 5 days ago

  • No changes, 1.x.x versions are compatible with Svelte 4
svelte-preprocess-react - 0.17.0 Latest Release

Published by bfanger 9 months ago

  • Locked peerDependency Svelte to v4 (For Svelte v5 try the 2.x beta )
  • Event forwarding #17
  • Upgraded development environment to SvelteKit 2
svelte-preprocess-react - 0.16.0

Published by bfanger about 1 year ago

  • Upgraded to Svelte v4
  • Upgraded to @svelte/package v2 and applied stricter imports/exports
    • Previously both:
    • import sveltify from "svelte-preprocess-react/sveltify";
    • import { sveltify } from "svelte-preprocess-react";
    • were supported, now only import { sveltify } from "svelte-preprocess-react"; is supported.
  • Switched from TS to JSDoc types for the preprocessor, simplifying the development setup.
svelte-preprocess-react - 0.15.0

Published by bfanger over 1 year ago

  • Examples now use @sveltejs/vite-plugin-svelte vitePreprocess instead of svelte-preprocess
  • Added input example
  • Added support for childless components, such as <react:input /> #25
svelte-preprocess-react - 0.14.0

Published by bfanger almost 2 years ago

#20 fix react key warning when using hooks

svelte-preprocess-react - 0.13.0

Published by bfanger almost 2 years ago

  • #18 Fix: Using <react:Component />in AST branches like inside {:else}, {:catch} block
  • Improved SSR (Slots & Cross framework contexts)
  • A number of router-router shims to use let React components to use the sveltekit router using react-router like api's.
svelte-preprocess-react - 0.12.0

Published by bfanger about 2 years ago

Use import * as React from "react" notation, this works for both bundled and native loaders.
( import { useState } from "react" fails in certain conditions because react is not ESM)

svelte-preprocess-react - 0.11.0

Published by bfanger about 2 years ago

Features

  • Added support for regular elements, to render a div via React:
    <react:div>A div</react:div>
    

Bugfixes

  • svelte components that use react:* without a script tag not longer result in Invalid Token
svelte-preprocess-react - 0.10.0

Published by bfanger about 2 years ago

Breaking

After updating to 0.10.0 you'll be getting a TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".svelte" error when starting vite dev.

Update the import in your svelte.config.js, change:

import preprocessReact from "svelte-preprocess-react";

into

import preprocessReact from "svelte-preprocess-react/preprocessReact";

This change allows importing the utilities directly from svelte-preprocess-react, for example:

import { useStore } from "svelte-preprocess-react";
  • Renamed useReadable to useStore
  • Removed useWritable (a writable store already has a set function)

Features

  • Using dot notation. <react:Context.Provider {value} />
  • hooks. Using hooks inside Svelte files