Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Creación de una interfaz para el componente dinámico nativo de reacción (elemento contenedor)
export interface IWEProps { accessibilityLabel: string; onPress?: ((status: string | undefined) => void) | undefined; localePrefix: string; children: JSX.Element[]; style: IWEStyle; type?: string; } class WrappingElement extends React.PureComponent<IWEProps> { render() { const { onPress, children, type, accessibilityLabel, style, } = this.props; return onPress ? ( <TouchableOpacity accessibilityLabel={accessibilityLabel} style={style} type={type} onPress={() => onPress(type)} > { children } </TouchableOpacity> ) : ( <View accessibilityLabel={accessibilityLabel} style={style} type={type} > { children } </View> ); } }

Esto es lo que estoy haciendo, y este es un error que obtengo al type prop en View y TouchableOpacity :

La propiedad 'tipo' no existe en el tipo 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El mensaje de error es sencillo: el type de prop no existe para los componentes View y TouchableOpacity . Los accesorios disponibles para View están documentados aquí . Los accesorios disponibles para TouchableOpacity se documentan aquí .

Dado que no está haciendo nada con el type en WrappingElement más que pasarlo a View y TouchableOpacity y la función onPress , simplemente puede eliminar este accesorio. El siguiente código es equivalente al tuyo, pero no arroja el error de tipo.

 export interface IWEProps { accessibilityLabel: string; onPress?: ((status: string | undefined) => void) | undefined; localePrefix: string; children: JSX.Element[]; style: IWEStyle; type?: string; } class WrappingElement extends React.PureComponent<IWEProps> { render() { const { onPress, children, type, accessibilityLabel, style, } = this.props; return onPress ? ( <TouchableOpacity accessibilityLabel={accessibilityLabel} style={style} onPress={() => onPress(type)} > { children } </TouchableOpacity> ) : ( <View accessibilityLabel={accessibilityLabel} style={style} > { children } </View> ); } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!