Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
How to check type of prop passing though one component to another component in react native?

I am trying to render Apple Button on Signup and Sign in screen and I have created the component for the same so that I can reuse the component in the login and Sign up screen but I need to send a prop which buttonType so that I can render button according to screen.

for eg:

<View style={{ margin: 50, marginBottom: 10 }}>
                  <AppleSignButton buttontype={"AppleButton.Type.SIGN_UP"} />
                </View>

But I am getting an error if I am trying this.

Error: Invariant Violation: requireNativeComponent: "RNAppleAuthButtonViewManagerWhiteAppleButton.Type.SIGN_IN" was not found in the UIManager.

AppleButton Component:

 <AppleButton
        buttonStyle={AppleButton.Style.WHITE}
        buttonType={props.buttontype} /* here if I try to replace it with "AppleButton.Type.SIGN_IN" then it outputs same error */
        style={{
          width: 200,
          height: 50,
        }}
        onPress={() => onAppleButtonPress()}
      />

Now, If I simply replace props.buttontype or "AppleButton.Type.SIGN_IN" this by AppleButton.Type.SIGN_IN it works fine.

So, my guess is that the prop I am sending to the component is in string format that's why the same error comes.

AppleButton Component:

export declare enum AppleButtonType {
  /**
   * The default button, the same as `SIGN_IN`.
   */
  DEFAULT = 'SignIn',

  /**
   * Renders the button with 'Sign in with Apple'.
   */
  SIGN_IN = 'SignIn',

  /**
   * Renders the button with 'Continue with Apple'.
   */
  CONTINUE = 'Continue',
  /**
   * Renders the button with 'Sign up with Apple'.
   *
   * > Note: This only works on iOS 13.2+. To check if the current device supports this, use the
   * provided `isSignUpButtonSupported` flag from the AppleAuth module.
   */
  SIGN_UP = 'SignUp',
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda