错误1如下图所示

错误原因:
子组件已经export default
- 不能使用import {FancyBorder} from "./FancyBorder.js" 引用
- 应该使用import FancyBorder from "./FancyBorder.js" 引用
错误二:
react-dom.development.js?61bb:88 Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property target
on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.
错误原因
e.target.value 不可以直接放到setstate里取值
解决办法:
先使用变量存值
再设置值
let value = e.target.value
this.setState({
value:value
})
网友评论