Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can use props #15458

Closed
Brhernann opened this issue Aug 11, 2017 · 1 comment
Closed

i can use props #15458

Brhernann opened this issue Aug 11, 2017 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Brhernann
Copy link

Hello,

I need to pass a function on the props, I have this component:

`import React, {Component} from 'react';
 import { View } from 'react-native';
 import {FBLogin, FBLoginManager} from 'react-native-facebook-login';
  
 const Loginfb = (props) => (
        <FBLogin
        style={{marginBottom: 10}}
        ref={props.ref}
        permissions={["email", "user_friends"]}
        loginBehavior={FBLoginManager.LoginBehaviors.SystemAccount}
        onLogin={props.login}

);

export default Loginfb;`

when props.ref and props.login are functions whit data. In my container component i have this:

`import React, {Component} from 'react';
 import {View} from 'react-native';
 import {FBLogin, FBLoginManager} from 'react-native-facebook-login';
 import Loginfb from '../components/fblogin';

class Inicio extends Component {

constructor(props) {
super(props);
this.state = {
  user: null,
};

}

Ref = (fbLogin) => {
this.fbLogin = fbLogin

}

login = (data) => {
console.log("Logged in!");
console.log(data);
this.setState({user: data.credentials});

}

render() {
     return (
        <View
             <Loginfb
              ref={this.ref} 
              onLogin={this.login}/>
        </View>
              );
       }
}
export default Inicio;`

i cant understand my error : "this.props[event] is not a function"

Please Help

@jozan
Copy link
Contributor

jozan commented Aug 12, 2017

Unfortunately this issue is not React Native specific. I'd suggest you to create new a question on StackOverflow with proper tags and check the issues on react-native-facebook-login repo if there's something similar.

@facebook facebook locked as resolved and limited conversation to collaborators Aug 13, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants