Download code/web/src/main.tsx from MiniMaxAI/oss-ecosystem-data: direct link, hf CLI and curl.
- Browser
- Download file 796 Bytes
-
https://huggingface.co/datasets/MiniMaxAI/oss-ecosystem-data/resolve/3c96cf2d04fca65e12deedeeed8b1e3e1a6fb6df/code/web/src/main.tsx
- Command line
-
hf download hf://datasets/MiniMaxAI/oss-ecosystem-data@3c96cf2d04fca65e12deedeeed8b1e3e1a6fb6df/code/web/src/main.tsx
-
curl -L -o main.tsx https://huggingface.co/datasets/MiniMaxAI/oss-ecosystem-data/resolve/3c96cf2d04fca65e12deedeeed8b1e3e1a6fb6df/code/web/src/main.tsx
796 Bytes
| import { Component, StrictMode, type ReactNode } from "react" | |
| import { createRoot } from "react-dom/client" | |
| import "./index.css" | |
| import App from "./App.tsx" | |
| // Light only, as minimax.io is; the galaxy carries its own .dark stage. | |
| // If the page and its data file ever disagree, say so instead of showing a blank page. | |
| class Fallback extends Component<{ children: ReactNode }, { failed: boolean }> { | |
| state = { failed: false } | |
| static getDerivedStateFromError() { | |
| return { failed: true } | |
| } | |
| render() { | |
| return this.state.failed ? <p style={{ padding: 40, fontSize: 18 }}>Something went wrong. Try refreshing the page.</p> : this.props.children | |
| } | |
| } | |
| createRoot(document.getElementById("root")!).render( | |
| <StrictMode> | |
| <Fallback> | |
| <App /> | |
| </Fallback> | |
| </StrictMode>, | |
| ) | |