Skip to content

sahilrajput03/learn-sandpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Learn sandpack-react

Quick Links:

NOTE: In console there is an error like - Service Worker registration failed: TypeError #1091 - You can track this issue here.

SandpackProvider is our main component, the one that takes a set of files and bundles them into an application. It then provides the necessary data to all child components via React context.

There are lots of additional LEGO™ bricks for us to mix and match, including things like SandpackFileExplorer, SandpackConsole, and SandpackTests.

For full customization, however, we need to access the underlying state. And that's where their custom hooks come in.

Open in Codesandbox Feature

  • Quoting from Josh: Initially, I didn't think much of this feature, but I've come to realize that it's amazing. It makes it super easy for folks to share chunks of code. If someone gets stuck on something and need help, they can click this button and send me the URL, instead of having to describe what they did, or copy/paste all of the code (which is often split across multiple files).

List of all templates available in sandpack

Docs: Click here

Predefined Themes

Editor?

Default editor in sandpack-react used is CodeMirror but you can switch to Monaco by following this section in docs: Click here

Other Custom Features ?