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

Method render

examples/lit/basic-graphql-request/src/post-detail.ts:25–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected