Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. {/*the below returns the error Uncaught "TypeError: Cannot read property 'then' of undefined"*/}
  3. {/*it has something to do with the then in the set.state promise, but I've tried a few ways to make a promise*/}
  4. {/*set.state and havent made headway.*/}
  5.  
  6. handleLogIn(username, password){
  7. {/*call to the backend and bcrypt goes here*/}
  8.  
  9.  
  10. console.log('inside App. username: ', username, ' password: ', password);
  11.  
  12. this.setState({
  13. username:username,
  14. password:password
  15. }).then(function() {
  16. console.log("poop");
  17. }.bind(this));
  18.  
  19. }
  20.  
  21.  
  22.  
  23. render() {
  24.  
  25. const xProfilePagex = () => {
  26. return(
  27. <div>
  28. <ProfilePage handleLogIn={this.handleLogIn.bind(this)}/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement