ReactJS console.log 几秒钟后消失

ReactJS console.log disappearing after some second

我通过单击按钮在我的 reactjs 应用程序中实现 SSO,并通过添加 console.log 来调试一个错误以查看 this.props.location 变量。但是当我点击 auth me 按钮(这将触发 sso auth)时,它会显示日志几秒钟然后消失。我拍了 printscreen

我想在控制台中展开对象并查看属性值,但无法执行,因为它正在消失。我也添加了等待计时器来保持阻塞但它被绞死了。有没有更好的方法,让我可以将 console.log 的数据记录到一个文件中,并在不匆忙的情况下和平地查看错误。

您必须在提交按钮中使用此代码以阻止默认提交事件。

onSubmitClicked = (e) => {
  e.preventDefault()
  //additional codes
}