How To Create A Layout Component: React

When creating a react application/website, most of the pages would be sharing the same content all over. For example the navigation bar and page footer. Instead of importing each component in every page to be rendered, it is much easier and faster to just create a layout component. This post will cover how to create a react app using Layout Components. Live demo: https://hjpx0v.csb.app/ Source Code to the demo: https://github.com/achingachris/react-layout-demo Here is how to do it: ...

May 29, 2022 · 2 min · Chris Achinga

Working with React Components + Props

What are props? In simple terms, they are data passed into components. When to use props? When building a react application, the UI is divided into smaller parts called Components. Some of these components are re-used in various pages or parts of the application, of course with different data/messages/content. For this to be effective, props are used. For example, a simple react website with two pages, all share a common <Head> element: ...

March 24, 2021 · 4 min · Chris Achinga