I've been working with Gatsby now for a couple of weeks, merging several different React Apps into one Gatsby React app - so far so good - its great and we are already seeing the benefits.
A use case has come up whereby we are looking to have a _hybrid page_ (static and client route). I can see documentation and examples for creating a _hybrid app_ with client-only routes, however, I'm looking at being able to do the following:
A single static and client route that can have:
I'm ploughing on ahead to hopefully get a sample app to test, but thought I would ask here also.
Much thanks in advance.
OK so after some testing, it seems that client-only routes do indeed generate both static and dynamic content on those routes.
If you use Gatsby and GraphQL in layouts to create the static app-shell (for example a GraphQL query to create a menu structure, with container divs and CSS etc) and then use React components with componentDidMount API calls to consume dynamic content.
This is perhaps the whole point of Gatsby client-only routes, however this wasn't clear from the documentation. I will do my best to contribute to the docs for other peoples use.
Answered by the doc updates on #3579
Most helpful comment
OK so after some testing, it seems that client-only routes do indeed generate both static and dynamic content on those routes.
If you use Gatsby and GraphQL in layouts to create the static app-shell (for example a GraphQL query to create a menu structure, with container divs and CSS etc) and then use React components with
componentDidMountAPI calls to consume dynamic content.This is perhaps the whole point of Gatsby client-only routes, however this wasn't clear from the documentation. I will do my best to contribute to the docs for other peoples use.