G
G
GaserV2018-01-31 13:16:48
React
GaserV, 2018-01-31 13:16:48

Why after clicking on the button infinitely calls the action?

Such situation. When you click on the button, you need to call a function that will later call the dispatcher. But after a click - the action works FIG knows how many times and everything freezes. Why?

//action
editRow = id => this.props.dispatch(editUser(id))

//jsx
  <Button onClick={e => this.editRow(row.id, e)}>
            <Icon type="edit" /> Edit row
          </Button>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question