...
/Incorporating the Config Component - Houses
Incorporating the Config Component - Houses
Learn how to use React Hooks in creating components in React TypeScript.
We'll cover the following...
Creating the Houses component
To build the front-end app of our real estate web application—the user interface (UI)—we'll use React TypeScript components. A component is one of the core building blocks of a React TypeScript application. It is an independent, reusable snippet of code that divides the UI into smaller pieces. This allows us to break down a UI into various pieces (called components), work on them individually, and merge them into a parent component, which becomes our final UI. As such, every application we develop in React TypeScript is made up of pieces called components. Components make building UIs easier. However, each component has its structure, APIs, and methods.
To create the Houses component, we'll create a file named Houses.tsx inside the already-created config folder, which is inside the src folder of our project directory. In this file, we'll add the following lines of code:
Line 1: We import
Reactand the two React Hooks,useEffectanduseState, fromreact.Line 2: We import the
Wrapperfrom theconfigfolder inside thesrcfolder.Line 3: We import the
Houseinterface from theinterfacesfolder inside thesrcfolder. ...