使用React Router访问URL参数?

时间:2016-05-02 16:48:47

标签: react-router

我阅读了React Router中关于URL参数的文档和教程,发现 能够access the parameters in this.props.params。 this.props.params在我的render()函数中是未定义的。我的网址目前如下所示:http://localhost:8000/?color=green我正在尝试访问颜色值。这是你如何访问参数或有没有其他方法来做到这一点?

1 个答案:

答案 0 :(得分:1)

要使用React Router访问网址参数,您可以使用 int* (*function)(int, int (*k)(int *)); ,其中int* (*fn)(int, int (*k)(int *)); fn : fn is a (*fn) : pointer (*fn)(int, int (*k)(int *)) : to a function taking as arguments - an int and - function pointer which takes a pointer to int and returns int int* (*fn)(int, int (*k)(int *)) : and returns a pointer to int 是您要获取的网址参数的名称。