Forms & Validation
React Hook Form, Formik, Yup validation, controlled vs uncontrolled inputs, error handling
1What is the main difference between a controlled and an uncontrolled input in React Native?
What is the main difference between a controlled and an uncontrolled input in React Native?
Risposta
A controlled input is managed by React state via value and onChangeText props, allowing full control over the value at any time. An uncontrolled input uses a ref to directly access the DOM value without going through React state. Controlled inputs are recommended as they facilitate real-time validation and synchronization with the application state.
2Which React Hook Form hook is used to register an input and handle its validation?
Which React Hook Form hook is used to register an input and handle its validation?
Risposta
The useForm hook from React Hook Form returns an object containing several methods and properties. The register method allows registering an input in the form and attaching validation rules to it. It returns the necessary props (onChange, onBlur, ref) to connect the input to the form management system.
3How to define an email validation schema with Yup?
How to define an email validation schema with Yup?
Risposta
Yup uses a chainable API to define validation schemas. To validate an email, use yup.string() to define the type, then chain .email() for email format validation, and optionally .required() to make the field mandatory. This declarative approach allows creating readable and reusable validations.
In Formik, which prop is used to define the initial values of the form?
What is the main performance advantage of React Hook Form compared to Formik?
+15 domande da colloquio
Altri argomenti di colloquio React Native
JavaScript Essentials
React Fundamentals
React Native Basics
React Hooks
TypeScript for React & React Native
React Native Components & API
React Native Styling & Layout
React Native Navigation
React Native State Management
React Native Networking & API
Data Persistence
React Native Animations
Native Modules & Bridge
Platform-Specific Code
Permissions & Device APIs
Push Notifications
React Native Testing
React Native Debugging
Build & Deployment
Expo vs React Native Bare
Performance Optimization
Memory Management
Architecture Patterns
React Native New Architecture
Security Best Practices
Offline-First Architecture
React Native CI/CD
Monorepo & Code Sharing
Advanced Topics
App Lifecycle & Background Execution
Authentication & Session Management
Monitoring & Crash Reporting
Padroneggia React Native per il tuo prossimo colloquio
Accedi a tutte le domande, flashcards, test tecnici, esercizi di code review e simulatori di colloquio.
Inizia gratis