简体   繁体   中英

Using Gatsby.js for dynamic and static web apps

I am building a web app for a startup from scratch and have decided to use react and graphQl to query mongodb with nodejs as my backend.

Gatsby.js seems to bundle react, graphql, and even redux with their framework, which is supported with many helpful plugins. So it seems like it could dynamically render content on the client side, and its also built for fast static rendering of the site on the client side. Seems perfect for my use case where...

Some features of this site would require dynamic AND static rendering of content on the client side...

are their better frameworks or solutions? or will this work?

Gatsby.js seems to bundle react, graphql, and even redux with their framework, which is supported with many helpful plugins

Gatsby is a framework for React and uses GraphQL/Redux among other things under the hood - you can't use eg Redux out of the box and GraphQL is the data layer to query Gatsby's content, not external APIs. Hope that clears things up.

Before investing my time in Gatsby.js I want to know if its possible, or practice to use Gatsby.js for a mix of static and dynamic web rendering.

Of course :) That's why Gatsby re-hydrates into a fully functional React app on the client - so that you can fetch additional APIs or do dynamic stuff on top of the rendered HTML.

Might be an interesting read for you: https://www.gatsbyjs.org/blog/2018-11-07-gatsby-for-apps/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM