Challenge: Creating a New Footer in Our Web Page
Let's apply what we have learned about children and function props in this coding exercise.
We'll cover the following
Overview
Using the code in the SPA widget below, perform the tasks below.
Requirements
In this challenge, you need to add a footer
component using children
prop and some text above the footer using function
prop into the project that we have developed. You can follow these steps:
Step 1: Footer.tsx
file
We have created a new file called Footer.tsx
.
Create a
functional
component calledFooter
with children and function prop.Use the
interface
keyword to define the prop types (children
andrenderContentAboveFooter
) below the importReact
statement.With in the
div
tag call the function prop and children prop to allow you render the content.
Get hands-on with 1400+ tech skills courses.