خرید بک لینک

Vote count: 0

My handleTeamChange function is erroring and coming back as undefined when the renderTeamMethod runs. I tried passing the variable team into on like "this.handleTeamChange.bind(this, team)" as well but nothing. I've tried a ton of different ways to call teh handleTeamChange method but so far nothing but undefined. Any thoughts?

componentWillMount() {
    getTeams().then((response) => {
        teams = response.data;
        this.setState({teams: teams});
    });
}

renderTeams() {
            retu teams.map(function(team) {
              console.log(team);
                if (team.active === true) {
                    retu (
                        <div onClick={ this.handleTeamChange.bind(this)} className="team-filter-team" key={team.id} value={team.id} >{team.TeamName}</div>
                    );
                }
            });
}


handleTeamChange() {
  console.log('hi');
}

render () {
  retu (
        <nav className="nav-wrapper">
            <img className="logo-medium nav-logo" src={"https://s3-us-west-2.amazonaws.com/mvtrak/MVTRAKbrandmark.png"} />
            <div onClick={ this.handleClick.bind(this) } className="team-selected"> { this.state.selectedTeamName } </div>
            <div className="team-filter-container">
                {this.renderTeams()}
            </div>
            <UserDropdown />
        </nav>

    );
}

asked 31 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 24 ارديبهشت 1395 ساعت: 1:37

صفحه بندی