I want a Sandpack Provider with no files (blank template) #970
Unanswered
jamesmurdza
asked this question in
Q&A
Replies: 2 comments
-
This is the workaround that I'm using now: useEffect(() => {
if (files["/App.js"]) {
deleteFile("/App.js");
}
if (files["/index.js"]) {
deleteFile("/index.js");
}
}, [deleteFile]); This deletes the template files when Sandpack loads. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can override it by explicitly defining your own file structure and custom setup. Here's how you can do it: <SandpackProvider
theme="auto"
files={{
'/user.sql': `CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
age INTEGER NOT NULL
);`,
}}
customSetup={{
entry: '/user.sql',
}}
>
<SandpackLayout>
<SandpackPreview />
<SandpackConsole />
</SandpackLayout>
</SandpackProvider> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I remove,
template="static"
from the below code, the template is still applied. I want to provide my own directory structure with a completely different list of files. How can I do this?Beta Was this translation helpful? Give feedback.
All reactions