To create a React app from scratch that displays a dynamic greetings message, based on the time of the day (it displays "Good Morning" if between midnight and 12PM, "Good Afternoon" if between 12PM and 6PM and "Good Night" if between 6PM and midnight)
To dynamically change the color of the greetings message, based on the time of the day (Morning = red, Afternoon = green, Night = blue)
To split the main codebase into sevral components for modualrity and reusability
Steps I have followed:
Installed react and react-dom dependencies and imported them inside the main index.js file:
Created logic inside index.js file to get the browser's current time and accordingly change the value of two custom variables - greeting and customStyle: