2.4.1 • Published 7 years ago
react-js-live v2.4.1
JS Live
A React Component for live rendering and editing of HTML, CSS and JS.

Usage
npm install react-js-liveimport React from "react";
import JSLive from "react-js-live";
import "react-js-live/build/main.css";
function App() {
return <JSLive id="test" snippets={snippets} mode="js" />;
}Props:
id
A string that uniquely identifies the frame on the page.
- snippets
Object containing keys: html, css and js. This is the initial code passed into the component.
const snippets = {
html: `<p>HTML Content goes here</p>`,
css: `.title { color: red; }`,
js: `alert(js)`
};mode
default:
jshtml: Left tab defaults to HTML and Right defaults to ResultjsLeft tab defaults to JS and Right tab to Console.
theme
default: Night Owl
Any PrismJS theme.Contributing
- Clone the repo
npm installnpm start