reactjs - 为什么我无法从 react-router 获取参数?
问题描述
https://github.com/Vladislav747/Electron_With_React
尝试从此处的参数获取 id - https://github.com/Vladislav747/Electron_With_React/blob/master/src/components/Editing/index.js 第 17 行 - 但未定义 - 哪里出错了???
解决方案
除非您不初始化构造函数,否则您将无法访问 this.props。请参阅:https ://stackoverflow.com/a/53022470/12855221 。
推荐阅读
- python - 使用分层排序按 2 列排序 [Pandas]
- sql - SQL按多列从一个序列中选择所有记录
- python - 在python中添加列标题以提取excel
- javascript - JavaScript Fetch API - 为什么在浏览器控制台中执行时返回未定义?
- javascript - 适用于 JavaScript 的 HERE Maps API 不适用于 IE11
- node.js - DynamoDb:如何根据具有最高编号的列获取项目?
- python - 如何创建具有特定 dtype 的新 Pandas 列?
- go - 处理程序提供服务后,如何从请求对象中取回记录器对象?
- rails-activestorage - 如何缩短 Rails Active Storage url 链接太长
- java - 如何遍历列表列表以操作内部列表的内容?