为什么Content组件的log输出打印两次,不应该是一次吗
通过create-react-app模式创建的,默认就是StrictMode下。StrticMode默认会执行两次render,来检测你的render函数有没有副作用。包一层React.StrictMode就可以了