0% found this document useful (0 votes)
4 views

React Practice Questions

The document contains a set of React practice questions designed to enhance skills in various aspects of React development. It includes tasks such as creating components, handling events, managing state, and implementing conditional rendering. Each question provides hints to guide the user in completing the exercises.

Uploaded by

priyanshu07264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

React Practice Questions

The document contains a set of React practice questions designed to enhance skills in various aspects of React development. It includes tasks such as creating components, handling events, managing state, and implementing conditional rendering. Each question provides hints to guide the user in completing the exercises.

Uploaded by

priyanshu07264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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)

You might also like