From abb8992665c154bf47b13c09fc7ed9180be482e7 Mon Sep 17 00:00:00 2001 From: Antoine BERNIER Date: Sun, 25 Aug 2024 08:41:42 +0200 Subject: [PATCH] docs: simplified sandpack --- docs/getting-started/authoring.mdx | 104 ++++++----------------------- 1 file changed, 21 insertions(+), 83 deletions(-) diff --git a/docs/getting-started/authoring.mdx b/docs/getting-started/authoring.mdx index 16ce2877..34dce7c1 100644 --- a/docs/getting-started/authoring.mdx +++ b/docs/getting-started/authoring.mdx @@ -61,60 +61,29 @@ Responsive grid. #### `Sandpack` -See https://sandpack.codesandbox.io/docs/getting-started/usage. +See [Sandpack docs](https://sandpack.codesandbox.io/docs/getting-started/usage). ```tsx (meshRef.current.rotation.x += delta)) - - return ( - setActive(!active)} - onPointerOver={(event) => setHover(true)} - onPointerOut={(event) => setHover(false)} - > - - - - ) -}`, - '/App.js': `import {Canvas} from '@react-three/fiber' -import {Box} from './Box' + '/styles.css': `html,body,#root {height:100%;margin:unset;}`, + '/App.tsx': `import { Canvas } from '@react-three/fiber' +import { Cloud, CameraControls } from '@react-three/drei' export default function App() { return ( - - - - - - + + + + ) }`, @@ -126,56 +95,25 @@ export default function App() { Result (meshRef.current.rotation.x += delta)) - - return ( - setActive(!active)} - onPointerOver={(event) => setHover(true)} - onPointerOut={(event) => setHover(false)} - > - - - - ) -}`, - '/App.js': `import {Canvas} from '@react-three/fiber' -import {Box} from './Box' + '/styles.css': `html,body,#root {height:100%;margin:unset;}`, + '/App.tsx': `import { Canvas } from '@react-three/fiber' +import { Cloud, CameraControls } from '@react-three/drei' export default function App() { return ( - - - - - - + + + + ) }`,