All fields

“Forms: Controlled & Uncontrolled Components” in Information Technology

22 questions across 1 technology.

Information Technology

22 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is an uncontrolled form input, and how does it differ from a controlled one? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsBeginner
2What is a controlled form input in React? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsBeginner
3How do you prevent a form from reloading the page when it is submitted in React? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsIntermediate
4How would you validate a form in React and show an error message to the user? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsIntermediate
5How does React Hook Form simplify building forms compared to managing every field with useState manually? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsAdvanced
6How do you set and update state correctly inside a class component? React › Class Components & Legacy Lifecycle MethodsReactClass Components & Legacy Lifecycle MethodsBeginner
7What is the controlled component pattern and why is it considered a best practice for forms? React › Design Patterns in ReactReactDesign Patterns in ReactIntermediate
8What is accessibility in React and why does it matter? React › Accessibility (a11y) in ReactReactAccessibility (a11y) in ReactBeginner
9What is a ref in React and what is it used for? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefBeginner
10What is cross site scripting, often called XSS, and how does React protect against it by default? React › Security in React (XSS & dangerouslySetInnerHTML)ReactSecurity in React (XSS & dangerouslySetInnerHTML)Beginner
11Why is it risky to build a link's web address directly from user input without checking it first? React › Security in React (XSS & dangerouslySetInnerHTML)ReactSecurity in React (XSS & dangerouslySetInnerHTML)Beginner
12What is a simple real world example of using a server action for a common form, like a newsletter signup? React › Server Actions & Data MutationsReactServer Actions & Data MutationsBeginner
13How do you type an event handler function, such as a button's onClick handler, in TypeScript? React › TypeScript with ReactReactTypeScript with ReactBeginner
14When should you choose useReducer over useState for managing a component's state? React › useReducer & Complex State LogicReactuseReducer & Complex State LogicBeginner
15How would you handle a mutation, such as creating a new item, using React Query? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Intermediate
16How would you programmatically navigate a user to a different page after they complete an action, such as submitting a form? React › RoutingReactRoutingIntermediate
17What is a server action in React and what problem does it solve? React › Server Actions & Data MutationsReactServer Actions & Data MutationsIntermediate
18How would you manage a multi step form's state using useReducer instead of several separate useState calls? React › useReducer & Complex State LogicReactuseReducer & Complex State LogicIntermediate
19What is forwardRef and why is it needed when passing a ref to a custom component? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefAdvanced
20How would you safely display user generated HTML content, such as a rich text comment, without exposing your app to XSS attacks? React › Security in React (XSS & dangerouslySetInnerHTML)ReactSecurity in React (XSS & dangerouslySetInnerHTML)Advanced
21How does the useFormStatus hook help show loading feedback while a server action is running? React › Server Actions & Data MutationsReactServer Actions & Data MutationsAdvanced
22How does the useFormState hook, sometimes called useActionState, let you show validation errors returned from a server action? React › Server Actions & Data MutationsReactServer Actions & Data MutationsAdvanced