We want to isolate main component from greeting text so we choose to create a welcome component that takes name as input and output a welcome message.
- Create a Welcome component(greeting message) in Welcome.js
- Use React functional component to do so.
- Output the welcome message "Hey !" where name is name of the student using h1 tag.
- Also render the "Welcome to Newton School." using h2 tag.
- A prop named "name" will be passed to Welcome component use it in writing greeting text.
- Welcome message should be as given in the Details section.
- Use of functional component.