Skip to content

Run button is not present if Preview component is not set. #28

@pixeleet

Description

@pixeleet
image

Given the following sandpackConfig

const sandpackConfig = {
  defaultPreset: "default",
  presets: [
    {
      name: "default",
      meta: "live",
      label: "TypeScript",
      sandpackTemplate: "vanilla-ts",
      sandpackTheme: "light",
      snippetFileName: "/index.ts",
      snippetLanguage: "ts",
      initialSnippetContent: [
        'import "./styles.css";',
        'document.getElementById("app").innerHTML = `<h1>Hello world</h1>`;',
      ].join("\n"),
    },
  ],
  panes: {
    console: true,
    preview: false,
  },
};

I guess the need for the solution where we pass down the Sandpack Panels as components instead of just flags is surfacing, as this setting is something we'd have to change on the SandpackCodeEditor by adding showRunButton prop.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions