How to use the react-live.LivePreview function in react-live

To help you get started, we’ve selected a few react-live examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gribnoysup / react-yandex-maps / docs / components / LiveEditor.js View on Github external
};

const PreviewContainer = styled(Flex)`
  border-radius: 2px;
  overflow: hidden;
`;

const StyledEditor = styled(ReactLive.LiveEditor)`
  &[class*='language-'] {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
`;

const StyledPreview = styled(ReactLive.LivePreview)`
  overflow: auto;
`;

const StyledError = styled(ReactLive.LiveError)`
  border-radius: 2px;
  overflow: auto;
`;

export class LiveEditor extends React.Component {
  constructor() {
    super();
    this.state = { editor: true, preview: true };
  }

  render() {
    const { code, language, noInline } = this.props;

react-live

A production-focused playground for live editing React code

MIT
Latest version published 3 months ago

Package Health Score

88 / 100
Full package analysis