This project was bootstrapped with Create React App.
npx create-react-app lesson5
cd lesson5
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
Create a react app with following components: <App />
, <NameInput />
:
There should be 2 state, one for name and one for surname.
Using useEffect
hook, when both name and surname are entered by user, the document title should changed to Hey, ${name} ${surname}
.
If name or surname is not provided title should be Both name and surname
.
Also, as a side effect print in console how many times the <App />
component rerenders
Your App
component should look like: