Skip to content

Latest commit

 

History

History

exercise-2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Exercise-2

In this exercise, you'll practice passing props to a simple react component. This is a simple extension of exercise-1, except we are passing values into the component via props

In your main.jsx file, you'll want to do the following:

  • Create a React component called MyComponent
  • Then, your render function should return a <div> with two <p> elements in side of it. The first <p> should say "Hello, my name is NAME", and the second should say "I am interested in INTEREST". Make sure to reference your component props
  • After you've created your component, you should use ReactDOM to render your component in the main element on your page. Make sure to pass variables into your component as props!