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 themain
element on your page. Make sure to pass variables into your component as props!