react-native-simple-login icon indicating copy to clipboard operation
react-native-simple-login copied to clipboard

onLogin is undefined

Open clucasalcantara opened this issue 8 years ago • 3 comments

Using this, on a react-native:

renderLogin() {
        const onLogin = (email, password) => {
            console.log(email, password) // user credentials
        }
        
        const onResetPassword = (email) => {
            console.log(email)
        }
        
        return (
            <Login
                onLogin={onLogin}
                onResetPassword={onResetPassword}
            />
        );
    }

The component warns me against the onLogin undefined :/, any idea?

clucasalcantara avatar Jun 14 '17 02:06 clucasalcantara

Maybe you should use:

<Login
       onLogin={this.onLogin}
       onResetPassword={this.onResetPassword}
/>

since you are defining those inside the component definition

cmelgarejo avatar Jun 25 '17 04:06 cmelgarejo

I've tried, but the same error appears :/, I'll probably missing something on the component definition.

clucasalcantara avatar Jun 27 '17 16:06 clucasalcantara

Hey @clucasalcantara, sorry for the delay...

I just tested the library on a brand new React Native App (created by create-react-native-app), and everything worked fine here.

I created a gist with the main application file (https://gist.github.com/chagasaway/39bfd15d03a08b8213337cd627c8e83a) that shows how I have integrated the library.

Can you test it or tell me if anything is different on your side?

Best regards, Fellipe

chagasaway avatar Sep 04 '17 22:09 chagasaway