JSPM

  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q76697F
  • License MIT

Reakit Playground

Package Exports

  • reakit-playground
  • reakit-playground/ErrorBoundary
  • reakit-playground/ErrorMessage
  • reakit-playground/PlaygroundEditor
  • reakit-playground/PlaygroundPreview
  • reakit-playground/system
  • reakit-playground/usePlaygroundState

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reakit-playground) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

reakit-playground

NPM version

Installation

npm:

npm i reakit-playground

Yarn:

yarn add reakit-playground

Usage

import React from "react";
import ReactDOM from "react-dom";
import {
  usePlaygroundState,
  PlaygroundEditor,
  PlaygroundPreview,
} from "reakit-playground";

const initialCode = `import React from "react";
import { Provider, Button } from "reakit";

function Example() {
  return (
    <Provider>
      <Button>Button</Button>
    </Provider>
  );
}
`;

function App() {
  const playground = usePlaygroundState({ code: initialCode });
  return (
    <div>
      <PlaygroundPreview {...playground} />
      <PlaygroundEditor {...playground} readOnly />
    </div>
  );
}

ReactDOM.render(<App />, document.getElementById("root"));

License

MIT © Diego Haz