Skip to content

Bindovanie listeneru do contextu react komponenty #15

Description

@bDivision

Proč naši funkci this.handleClick ještě balíme do další funkce s fat arrow =>?

Túto funkciu nemusíme baliť do anonymnej funkcie; môžeme ju nabindovať aj pomocou metódy bind:

onClick={this.handleClick.bind(this)}

A dávam pochvalu za výborný článok ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions