React Router in 3 minutes

Implement routing into a React app is so easy, the first step is to install react-router -dom package. npm i react-router-dom In the App.js import 3 essentials elements BrowserRouter, Route and Switch from react-router-dom, these handle our routes, create links and load components. import { BrowserRouter as Router, Route, Switch } from “react-router-dom”; Every one…

Gatsby, StaticQuery, and PageQuery part 3

Today is my 3rd day with Gatsby, if you read my previous post about GraphQL, I had a pending task bind the data from GraphQL using StaticQuery component and query in Pages. StaticQuery is used to connect our components with GraphQL, it can wrap all component and bring access to the query result. Page Query is const with the GraphQl…

How to React Type checking

The components in React allow receive data using Props, the props aren’t is strict, that’s mean you can send any type of value, or forget to send some value. In our example, the component Calculator needs 2 props number1 and number2. import React, { Component } from ‘react’; export default class Calculator extends Component { render() { const {…