React Practice Questions
React Practice Questions
1. Basic JSX
Create a React component that displays a heading (h1) with 'Hello, React!'.
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)
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)