Migrating from react-live
Issue-by-issue parity with open react-live issues (Storybook #200 excluded).
Issue parity#
| Issue | react-live | next-live 1.0 |
|---|---|---|
#413 bad React.useEffect crashes site | Host can crash | Error boundary + compile isolation |
| #411 Docusaurus / MDX | Fragile | next-live-docusaurus plugin |
| #410 custom LiveError | Workarounds | children, onError, formatError, error.code |
| #409 / #375 paste / cursor | use-editable bugs | Native <textarea> + browser tests |
| #405 JSX automatic runtime | Open | Default automatic runtime |
| #396 SSR docs | Sparse | SSR-safe provider |
#391 scope / default | Collisions | Skipped reserved keys + prefer modules |
| #390 / #374 a11y | Partial | Escape→Tab, focus ring, ARIA |
| #319 fontFamily vs theme | Breaks Prism | Shared CSS variables on both layers |
| #278 Next.js build | Hydration / duplicate React | SSR-safe, peer React, "use client" stamping |
| #207 import warnings | Generic | ModuleNotFoundError + suggestions |
| #201 line wrap | Open | wrap={true} |
| #87 line highlight | Open | highlightLines, lineNumbers |
| #41 inline errors | Partial | <LiveError> + editor line highlight + diagnostics |
| #34 Prettier | Open | format + next-live/prettier |
| #24 selection API | Open | onSelectionChange, ref handle |
Prop mapping#
| react-live | next-live |
|---|---|
scope | modules + real import (prefer) or scope |
noInline + render() | Snippets may call injected render() |
transformCode | transform on provider / runner |
LiveEditor import | next-live/editor |
theme on provider | theme 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.
