# TypeScript con React (React / Next.js) > Tipos para props, state, events, generics, FC type, children type, tipado de hooks - 20 preguntas de entrevista - Mid-Level - [Preguntas de entrevista: React / Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista.md) ## 1. ¿Cuál es la sintaxis correcta para tipar las props de un componente React? **Respuesta** La interfaz Props seguida del tipado de la función con Props como parámetro es la sintaxis estándar recomendada. Este enfoque ofrece una excelente inferencia de tipos y permite reutilizar fácilmente el tipo Props en otras partes del código. Es más explícito que React.FC y permite un mejor control del tipado de children. ## 2. ¿Cómo tipar correctamente un state simple con useState? **Respuesta** TypeScript infiere automáticamente el tipo del state a partir del valor inicial pasado a useState. Para un valor simple como un string, no es necesario especificar explícitamente el tipo genérico. La inferencia automática es suficiente y hace el código más conciso. El tipado explícito solo es útil para uniones o cuando el valor inicial es null. ## 3. ¿Cuál es el tipo correcto para un evento onClick en un botón? **Respuesta** React.MouseEvent es el tipo específico para eventos de clic en un botón. El parámetro genérico HTMLButtonElement especifica el elemento DOM involucrado, lo que permite acceder a las propiedades específicas del botón a través de event.currentTarget. Usar MouseEvent del DOM nativo o un tipo demasiado genérico haría perder esta precisión de tipado. ## 17 preguntas más disponibles - ¿Qué tipo usar para tipar los children de un componente wrapper? - ¿Cuál es la diferencia principal entre React.FC y el tipado directo? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista React / Next.js - [Fundamentos de JavaScript](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/javascript-essentials.md): 25 preguntas, Junior - [Fundamentos de React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-fundamentals.md): 20 preguntas, Junior - [React Hooks](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-hooks.md): 22 preguntas, Junior - [Ciclo de vida de los componentes](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/component-lifecycle.md): 18 preguntas, Junior - [React Router](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-router.md): 20 preguntas, Junior - [Gestión de estado con Context](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/state-management-context.md): 18 preguntas, Junior - [Formularios y Controlled Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/forms-controlled-components.md): 20 preguntas, Mid-Level - [Obtención de datos y API](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/fetching-data-api.md): 20 preguntas, Mid-Level - [React Query (TanStack Query)](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-query-tanstack.md): 20 preguntas, Mid-Level - [Styling & CSS-in-JS](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/styling-css-in-js.md): 18 preguntas, Mid-Level - [Fundamentos de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-fundamentals.md): 25 preguntas, Mid-Level - [Data Fetching en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-data-fetching.md): 24 preguntas, Mid-Level - [Server Actions de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-server-actions.md): 20 preguntas, Mid-Level - [Routing y Navegación en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-routing-navigation.md): 22 preguntas, Mid-Level - [API Routes de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-api-routes.md): 20 preguntas, Mid-Level - [Metadata & SEO en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-metadata-seo.md): 18 preguntas, Mid-Level - [Middleware y Auth en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-middleware-auth.md): 22 preguntas, Mid-Level - [Testing en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-testing.md): 20 preguntas, Mid-Level - [Zustand State Management](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/zustand-state-management.md): 18 preguntas, Mid-Level - [Optimización de Rendimiento en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-performance-optimization.md): 22 preguntas, Senior - [Error Boundaries & Error Handling](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-error-boundaries.md): 18 preguntas, Senior - [Advanced React Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/advanced-react-patterns.md): 20 preguntas, Senior - [Características avanzadas de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-advanced-features.md): 24 preguntas, Senior - [Despliegue y Producción de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-deployment-production.md): 20 preguntas, Senior - [Architecture & Design Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-architecture-patterns.md): 22 preguntas, Senior - [React Server Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-server-components.md): 26 preguntas, Senior - [Internacionalización de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-internationalization.md): 20 preguntas, Senior - [React Security & Buenas Prácticas](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-security-best-practices.md): 22 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/typescript-react