-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.tsx
49 lines (44 loc) · 1.1 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"use client";
import { Sandpack } from "@codesandbox/sandpack-react";
const App = () => {
const files = {
"App.tsx": `import React from "react";
import * as ReactDOM from "react-dom/client";
import { ChakraProvider, Button} from "@chakra-ui/react";
const HelloWorld = () => {
return (
<Button>Hi</Button>)
}
const rootElement = document.getElementById("root");
ReactDOM.createRoot(rootElement).render(
<ChakraProvider>
<App />
</ChakraProvider>
);`,
};
return (
<Sandpack
files={files}
template="react-ts"
options={{ editorHeight: "400px" }}
customSetup={{
dependencies: {
"@chakra-ui/react": "latest",
"@chakra-ui/icons": "latest",
"@emotion/react": "latest",
"@emotion/styled": "latest",
"framer-motion": "latest",
react: "latest",
"react-dom": "latest",
"react-scripts": "latest",
},
devDependencies: {
"@types/react": "latest",
"@types/react-dom": "latest",
typescript: "latest",
},
}}
/>
);
};
export default App;