UNPKG

@aliemir/react-live

Version:

A production-focused playground for live editing React code

8 lines (6 loc) 256 B
import React, { useContext } from "react"; import LiveContext from "./LiveContext"; export default function LiveError({ Context = LiveContext, ...props }) { const { error } = useContext(Context); return error ? <pre {...props}>{error}</pre> : null; }