Estoy tratando de representar el botón de Apple en la pantalla de registro e inicio de sesión y he creado el componente para el mismo para poder reutilizar el componente en la pantalla de inicio de sesión y registro, pero necesito enviar un accesorio con el tipo de buttonType para poder procesar botón de acuerdo a la pantalla.
por ejemplo:
<View style={{ margin: 50, marginBottom: 10 }}> <AppleSignButton buttontype={"AppleButton.Type.SIGN_UP"} /> </View>Pero estoy recibiendo un error si estoy intentando esto.
Error: Invariant Violation: requireNativeComponent: "RNAppleAuthButtonViewManagerWhiteAppleButton.Type.SIGN_IN" was not found in the UIManager.
Componente AppleButton:
<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()} /> Ahora, si simplemente reemplazo props.buttontype o "AppleButton.Type.SIGN_IN" esto por AppleButton.Type.SIGN_IN funciona bien.
Entonces, supongo que el accesorio que estoy enviando al componente está en formato de cadena, por eso aparece el mismo error.
Componente AppleButton:
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', }