Galería en React (host CE)
El mismo image-gallery usado dentro de un App React vía esm.sh.
React só hospeda a tag. O Custom Element (definido no topo do TSX) cuida do grid e do evento.
Esqueleto HTML (cómo monta React)
El playground inyecta #root, import map (esm.sh) y Sucrase. La pestaña HTML es solo markup extra fuera de React. Nombra el componente de nivel superior App.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>/* CSS tab */</style>
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@19",
"react-dom/client": "https://esm.sh/react-dom@19/client"
}
}
</script>
</head>
<body>
<div id="root"></div>
<!-- HTML tab: optional markup outside React -->
<script type="module">
// Sucrase compiles the TSX tab, then:
// createRoot(document.getElementById('root')).render(<App />)
</script>
</body>
</html>Vite local: index.html → src/main.tsx → <App /> en #root. Aquí el playground hace el equivalente con esm.sh + Sucrase.
HTML (fuera de #root)
CSS
TSX / React
Vista previa en vivo