search

Home  >  Q&A  >  body text

javascript - [Multiple Picture Warning] When reactjs clicks on a table to edit content, the id error is reported as undefined when jumping to pass the value this.context.router.params.id

I would like to ask you all, as mentioned above, when you click "Edit" on a row of a table to change its content, use
this.context.router.push("/user/edit/" user .id) jump to pass value. When using this.context.router.params.id to obtain the id in the editing component, the error Cannot read property 'id' of undefined is reported? ? It's quite confusing, please give me some advice. . . The details are as follows:
The first is the table page, with an edit button at the bottom and a jump function above:

Secondly, the routing settings of index.js should be fine:

It is the editing page again, to automatically fill in the form after obtaining the data. There are some verification rules:

我想大声告诉你我想大声告诉你2723 days ago1306

reply all(1)I'll reply

  • 欧阳克

    欧阳克2017-07-05 10:39:17

    Check the this.context.router.params value in the editing component. You are reporting an error because this value is undefined. See if you can access this value

    reply
    0
  • Cancelreply