React Practice Questions Set
1. Basic JSX
Create a React component that displays a heading (h1) with 'Hello, React!'.
2. Button Click Event
Create a button that, when clicked, shows an alert saying 'Button Clicked!'.
(Hint: Use onClick event)
3. Counter App
Create a counter app where clicking a button increases the count by 1.
(Hint: Use useState)
4. Toggle Visibility
Create a button that toggles the visibility of a paragraph.
(Hint: Use useState with true/false)
5. Input Field Handling
Create an input box where users can type, and show the typed text below it.
(Hint: Use useState and onChange event)
6. Conditional Rendering
Display 'Logged In' if a user is logged in, else show 'Not Logged In'.
(Hint: Use useState and conditional rendering)
7. List Rendering
Create a list of tasks and display them using map function.
(Hint: Use array and map method)
8. Passing Props
Create a Parent component that sends a message to a Child component using props.
9. Dynamic Styling
Change the button color to red when clicked.
(Hint: Use useState and inline styles)
10. Form Handling
Create a simple login form with username and password fields.
(Hint: Use useState and form submission event)