如何将提取的用户 ID 放入 mern 堆栈中的文本字段中

How to put the extracted user ID in the textfield in mern stack

已解决 使用 this.props.match.params.id

有很多方法可以得到它,但我更喜欢这种方式。

const url ="http://localhost:3000/5f539fbf8e7b1c16806a863f%20/new_appointment"

const idMix = url.split("/")[3]

const id = idMix.split("%")[0]

希望它能解决您的疑问。