# Solid Playground ## Setup Create a `src` folder in this directory, then add the two files below. ### `src/main.tsx` ```tsx import { render } from '@solidjs/web'; import { App } from './App.tsrx'; const target = document.getElementById('root'); if (!target) throw new Error('#root not found'); render(() => , target); ``` ### `src/App.tsrx` ```tsrx import { createSignal, onSettled } from 'solid-js'; function Child() { return
{'I am a child component'}
; } export function App() { const [count, setCount] = createSignal(0); const items = [1, 2, 3]; let buttonEl; onSettled(() => { console.log('mounted, button is', buttonEl); }); return ( <>

{'Hello Solid World'}

if (count() > 5) {
{'count is big: ' + count()}
} else if (count() > 2) {
{'count is medium: ' + count()}
} else {
{'count is small: ' + count()}
} <>

Fragment content via {' <>...'}

); } ``` ## Run ```bash pnpm install pnpm run dev ```