MCPcopy Create free account
hub / github.com/TanStack/devtools / App

Function App

examples/react/basic/src/index.tsx:166–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164 </p>
165 )
166}
167
168function App() {
169 const [state, setState] = useState(1)
170 const [win, setWin] = useState<Window | null>(null)
171 const [postId, setPostId] = useState(-1)
172 return (
173 <main className="example-shell">
174 <Context.Provider value={{ count: state, setCount: setState }}>
175 <QueryClientProvider client={queryClient}>
176 <header className="example-header">
177 <p className="example-eyebrow">TanStack Devtools</p>
178 <h1>React basic example</h1>
179 <p>
180 Explore cached posts, plugin panels, and the development-only
181 accessibility fixture in one focused sandbox.
182 </p>
183 </header>
184 <WebMcpProof />
185 <section
186 className="example-card example-actions"
187 aria-label="Example controls"
188 >
189 <p>
190 Current count <strong>{state}</strong>
191 </p>
192 <div className="example-button-row">
193 <Button onClick={() => setState(state + 1)}>
194 Increment count
195 </Button>
196 <Button onClick={() => setWin(window.open('', '', 'popup'))}>
197 Open a new window
198 </Button>
199 </div>
200 </section>
201 {win && createPortal(<Mounted />, win.document.body)}
202 <section className="example-card example-content">
203 <Feature />
204 <p>
205 As you visit the posts below, you will notice them in a loading
206 state the first time you load them. However, after you return to

Callers

nothing calls this directly

Calls 1

setStateFunction · 0.85

Tested by

no test coverage detected