Intro to Advanced React Hooks
Add to favorites
Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud
Play video

Advanced React Hooks
1
Intro to Advanced React Hooks
12:47
2
Adaptive Layout and Styled Components
31:18
3
Basic Hooks
16:53
4
Custom Hooks
17:24
5
Hooks Libraries
8:13
6
Grid Layout
24:30
7
Static Data
8:46
8
Contentful CMS
14:07
9
Fetch Data with GraphQL
15:18
10
Passing Props
5:46
11
Page Template
17:37
12
Dynamic Pages
24:19
13
Layout Component
6:36
14
Markdown into HTML
19:18
15
Code Highlighting
10:06
16
SEO
15:29
17
Context API
14:55
18
Lighthouse Audit
11:19
19
Version Control with Github
3:39
20
Deploy with Gatsby Cloud
7:19
What you'll build
This is a preview of the final result: https://advancedreacthooksmaster.gatsbyjs.io/.
Recommendation
I highly recommend starting your coding journey with Build a web app with React Hooks.
Figma Design System
Similar to the Build a web app with React Hooks course, the design file was created in Figma, and you can download it to see how the design system works.
React Hooks
In addition to making React easier, you can add Hooks to it, so you can easily manage your component's state and lifecycle. For instance, you can import the useState hook and handle the state of your component. Learn more.
const [state, setState] = useState(initialValue)
Framework
With Gatsby, you can create static content-driven websites. It takes care of all the configuration for you. Complex websites can also be built with Gatsby - for example, the current Design+Code website. Gatsby is known for its outstanding search engine optimization, performance, scalability, accessibility, and security. Learn more.
Install NodeJS
NodeJS needs to be installed in order to run all Javascript libraries, including Gatsby, Styled Components, and React.
Install VSCode Editor
Coding requires the use of a code editor and Visual Studio Code is one of the most popular one. This code editor has the advantage of being lightning fast, supporting hundreds of languages, code snippets and extensions eco-systems.
VSCode extensions
- VS Code ES7 React/Redux/React-Native/JS snippets
- VSCode GraphQL
- Node npm
- Path Autocomplete for Visual Studio Code
- Prettier Formatter for Visual Studio Code
- vscode-styled-components
Installing Gatsby
Gatsby must be downloaded via NodeJS. Open your build-in terminal.
npm install -g gatsby-cli
*If you have an error while installing the gatsby-cli, use this command instead and enter your password.
sudo npm install -g gatsby-cli
Gatsby project
Let's create the project now. The project will be saved in your downloads folder.
cd Downloads
gatsby new advancedHooks
Preview your app
Open your new folder in VSCode by dragging and dropping in your dock. Use the integrated terminal with CTRL+` and start your environment locally.
gatsby develop
By clicking on the http://localhost:8000, it will open a web browser link and display your site.
Site architecture
- Src (source) is a folder that contains components and pages. Every reusable component in your project goes into the components folder such as buttons, cards, animations, rows, lists ...
- Pages, a new page will be created automatically for each file. Pricing.tsx, for example, will route to /pricing. Only index.tsx will route to the main page.
-
Static folder contains all your assets, such as images, logos, etc
Typescript
We will be using typescript in this project. Typescript is an extremely powerful and useful tool when dealing with data. By checking what type of data is being fetched, you can avoid unintentional bugs. Check out this section for more information.
Install Typescript
Learn how to install Typescript on your Gatsby project by following this tutorial.
// gatsby-config.js
plugins: [
`gatsby-plugin-typescript`,
// More plugins...
],
Allows Gatsby to build TypeScript and TSX files.
npm i gatsby-plugin-typescript
With TypeScript, JavaScript can be extended to support tools for large-scale JavaScript applications on any device or operating system. It can be compiled into readable and standards-compliant JavaScript.
npm i typescript --save-dev
Allowing types for React.
npm i --save-dev @types/react @types/react-dom @types/node
Finally, change the following files to .tsx instead of .js.
- header.js → header.tsx
- layout.js → layout.tsx
- seo.js → seo.tsx
- 404.js → 404.tsx
- index.js → index.tsx
- page-2.js → page-2.tsx
*Make sure to not change the Gatsby configuration at the bottom.
React plugin type
It's possible to encounter issues with react plugins that aren't compatible with Typescript. For example, the helmet plugin in SEO. To fix it, install the type version of it.
npm i --save-dev @types/react-helmet
Templates and source code
Download source files
Download the videos and assets to refer and learn offline without interuption.
Design template
Source code for all sections
Video files, ePub and subtitles
Videos
Assets
ePub
Subtitles
1
Intro to Advanced React Hooks
Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud
12:47
2
Adaptive Layout and Styled Components
Make your design responsive for different devices with styled components and media query
31:18
3
Basic Hooks
Use hook to trigger an animation
16:53
4
Custom Hooks
Make your own hook with useState
17:24
5
Hooks Libraries
Make use of the hook collections made by the community
8:13
6
Grid Layout
How to make a grid-based layout system with CSS
24:30
7
Static Data
Create an array of components using JSON data
8:46
8
Contentful CMS
Manage your content with a CMS platform
14:07
9
Fetch Data with GraphQL
Populate your components with dynamic data
15:18
10
Passing Props
Passing data to a child element
5:46
11
Page Template
Set up a page template component
17:37
12
Dynamic Pages
Generate dynamic pages with Gatsby's createPages API
24:19
13
Layout Component
Share component accross multiple pages with layout
6:36
14
Markdown into HTML
Render Markdown content in your website
19:18
15
Code Highlighting
Enhance your content's readability
10:06
16
SEO
Improve organic traffic to your website
15:29
17
Context API
Manage states across your whole app
14:55
18
Lighthouse Audit
Monitor your app's performance with Lighthouse
11:19
19
Version Control with Github
Host your development project online
3:39
20
Deploy with Gatsby Cloud
Building and deploying your Gatsby site
7:19
Meet the instructor
We all try to be consistent with our way of teaching step-by-step, providing source files and prioritizing design in our courses.
Willie Yam
Front-end/UI developer at Design+Code
I do UI coding. HTML/CSS/JS/SWIFTUI dev.
10 courses - 37 hours

Design and Prototype an App with Play
Build a completely functional prototype without writing a single line of code from your phone
3 hrs

Create a 3D site with game controls in Spline
Build an interactive 3D scene implemented on a ReactJS site using Figma and Spline
2 hrs

Build a Movie Booking App in SwiftUI
Learn how to create an iOS app based on a beautiful UI design from Figma with interesting animations and interactions, create a custom tab bar and use navigation views to build a whole flow
1 hrs

Build Quick Apps with SwiftUI
Apply your Swift and SwiftUI knowledge by building real, quick and various applications from scratch
11 hrs

CSS Handbook
A comprehensive series of tutorials that encompass styled-components, CSS, and all layout and UI developments
1 hrs

Advanced React Hooks
Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud
5 hrs

Unity for Designers
If you want to make a game and don't know where to start, you are in the right place. I will teach you how to use Unity, code in C# and share essential tips and tricks to make your first game.
5 hrs

Create a Javascript Game
Learn how to create a web game using Phaser 3, a popular javascript game engine. Draw a map using an editor, implement the player, make the player move, apply physics, collisions, and implement the enemies.
2 hrs

Build an ARKit 2 App
Introduction to ARKit and learn how to make your own playground. You will be able to add models or even your own designs into the app and play with them
4 hrs

Create a SpriteKit Game
Overview of SpriteKit a powerful 2D sprite-based framework for games development from Apple and learn how to create your very own platform
3 hrs