2
所以,我試過所有這些,但都沒有工作。同樣的錯誤的ReactJS路由可選ID的URL參數
<Route name="create-course" handler={CreateCourse} path="/course-builder/create-course/{:id}" />
<Route name="create-course" handler={CreateCourse} path="/course-builder/create-course/[:id]" />
<Route name="create-course" handler={CreateCourse} path="/course-builder/create-course{/id}" />
變種:
Error: Invariant Violation: Missing "id" parameter for path "/course-builder/create-course/{:id}"
/{:?ID}一個不會引發錯誤,但URL成爲
/course-builder/create-course/%7B%7D
請幫助!
謝謝!實際工作的唯一解決方案。 – premunk