报错信息如下,因为刚学taro有很多不懂,所以在错误中成长啦。
js代码是这样写的
先简单说说报错原因吧,首先这是种函数式定义组件的方法,由于一个文件不能定义两个组件,但有时候我们需要组件内部的抽象组件,这时类函数式组件就是你想要答案。
但这样的写法也存在一些限制:
render
所以改成render开头的,比如这样的
就可以的