MCPcopy Create free account
hub / github.com/TanStack/query / render

Method render

examples/lit/default-query-function/src/post-detail.ts:27–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 }
26
27 render() {
28 const { isPending, isError, isFetching, data, error } = this.post()
29
30 return html`
31 <div>
32 <div>
33 <a href="#posts" @click=${this.back}>Back</a>
34 </div>
35 ${
36 !this.postId || isPending
37 ? html`<div>Loading...</div>`
38 : isError
39 ? html`<span>Error: ${error.message}</span>`
40 : html`
41 <h1>${data.title}</h1>
42 <div>
43 <p>${data.body}</p>
44 </div>
45 <div>${isFetching ? 'Background Updating...' : ' '}</div>
46 `
47 }
48 </div>
49 `
50 }
51}
52
53customElements.define('post-detail', PostDetail)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected