B
B
Breezy
Search…
Loading a tab onClick
Some features require loading content onCLick. For example, when a user clicks on an inactive tab to load its content async.
1
# /posts.json.props
2
3
json.posts do
4
json.all do
5
end
6
7
json.pending(defer: :manual) do
8
end
9
end
Copied!
1
//...in your component
2
render() {
3
return (
4
<ol className='tabs'>
5
<li> tab1 </li>
6
<li> <a href="/posts?bzq=data.posts.pending" data-bz-remote={true}>tab2</a> </li>
7
<ol>
8
....
9
)
10
}
Copied!
defer: :manual will instruct PropsTemplate to render the page without that node. You need to manually request the missing content using template querying like the example above.
Last modified 3mo ago
Copy link