Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda