Skip to content

Migrating from react-live

Issue parity and prop mapping

Migrating from react-live

Issue-by-issue parity with open react-live issues (Storybook #200 excluded).

Issue parity#

Issuereact-livenext-live 1.0
#413 bad React.useEffect crashes siteHost can crashError boundary + compile isolation
#411 Docusaurus / MDXFragilenext-live-docusaurus plugin
#410 custom LiveErrorWorkaroundschildren, onError, formatError, error.code
#409 / #375 paste / cursoruse-editable bugsNative <textarea> + browser tests
#405 JSX automatic runtimeOpenDefault automatic runtime
#396 SSR docsSparseSSR-safe provider
#391 scope / defaultCollisionsSkipped reserved keys + prefer modules
#390 / #374 a11yPartialEscape→Tab, focus ring, ARIA
#319 fontFamily vs themeBreaks PrismShared CSS variables on both layers
#278 Next.js buildHydration / duplicate ReactSSR-safe, peer React, "use client" stamping
#207 import warningsGenericModuleNotFoundError + suggestions
#201 line wrapOpenwrap={true}
#87 line highlightOpenhighlightLines, lineNumbers
#41 inline errorsPartial<LiveError> + editor line highlight + diagnostics
#34 PrettierOpenformat + next-live/prettier
#24 selection APIOpenonSelectionChange, ref handle

Prop mapping#

react-livenext-live
scopemodules + real import (prefer) or scope
noInline + render()Snippets may call injected render()
transformCodetransform on provider / runner
LiveEditor importnext-live/editor
theme on providertheme on <LiveEditor>

Minimal migration#

// Before (react-live)
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live';

// After (next-live)
import { LiveProvider, LivePreview, LiveError } from 'next-live';
import { LiveEditor } from 'next-live/editor';

<LiveProvider code={source} modules={yourRegistry}>
  <LiveEditor />
  <LivePreview />
  <LiveError />
</LiveProvider>

Register npm packages and app modules in modules instead of passing them through scope.