也许任何人都能告诉我们为什么会发生这种违规行为。
我们使用Emabrcadero RAD Studio 2010。有时,项目会损坏,我们无法进入项目选项。当我们尝试进入时,它会显示下一条错误消息:
Access violation at address 00000000. Read of address 00000000
如果我们尝试第二次输入它,它会显示:
Access violation at address 209931F1 in module 'coreide140.bpl'. Read of address 00000000
从这一点来看,所有项目都会抛出相同的错误,
我有一个简单的演示
这是一个基本的反应应用程序使用类型记录。
我有一个组件,是一个Navbar,它只是在一个简单的div中显示了一些链接。
在这个演示中,Navbar显示在页面上,但是在我的实际应用程序中它没有显示,我在控制台中得到了一个错误
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes'. TS2559
当您在演示中的Navbar上悬停时,您可以看到这一点,下面是红色的线条。
为什么我要得到这个错误,以及如何修复它。
所以如果我在componentDidMount生命周期中有一个api
constructor() {
this.source = axios.CancelToken.source();
}
componentDidMount() {
axios.get('some-api-url', {
cancelToken: this.source.token,
});
.then(res => {
// set state here or do something based on response i get
})
.catch(er
我有一个功能组件,它有一个子组件。子组件显示一些文本,这些文本是通过props从父组件传递到它上面的。当我更改父组件中的文本并将其向下传递时,子组件仍然保留旧文本。
下面是父组件MainPage的最小可重现示例。
function MainPage(){
let text = "This is the original text";
setTimeout(function(){ text = "This is the new text" }, 3000);
return(<DisplayText text={text} />)