![]() A key fact about developing in Gatsby is that each page is a React component. Gatsby is built on React, so you have the full range of React capabilities at your disposal. (Be sure the app is running in dev mode either background the process or open a new command-line window.) Add a page Gatsby ships with HMR (hot module replacement) active, so go ahead and modify the element in /src/pages/index.js to be My Home Page> and you will immediately see this change reflected in the browser. Gatsby welcome screen IDG Hot module replacement Once that is running, you can visit localhost:8000 and see the welcome screen as in Figure 1. Now you can run the app in dev mode by cd-ing into the new directory (my-demo) and typing gatsby develop. You can leave the choices blank for which additional plug-ins to add. When prompted for which CMS to use, you can accept “No (or I’ll add it later)” as the response. I named my project “My Demo” and accepted the default location of my-demo. Gatsby will largely hold your hand through the interactive process, and any choices you make can be changed later. Start building a new app with gatsby new. When that is complete, you should be able to type gatsby -v and get a response with the installed version. Once you have access to NPM from the command line, use it to install Gatsby globally by typing npm install -g gatsby-cli. You’ll need access to a command line to a Node.js/NPM installation, as well as to Git, which is used to download the starter kit. Let’s dive right in - it’s the best way to get a sense for how Gatsby works and what it offers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |