TypeError: instance.render is not a function
class RightSelectView extends Component {
render() {
return (
<div className="ContentViewStyle">
</div>
);
}
}
在用繼承React.Component的方式生成一個組建的時候,如果沒有生成render()系統(tǒng)會報錯
TypeError: instance.render is not a function。
在React使用img標簽的時候不能直接使用src填寫路徑
方法一
import imgURL from 'photo.png';
<img src={imgURL } />
方法二
<img src={require('./../images/photo.png')} />
reaquire后跟路徑是字符串不能為變量。