REACT Native可以进口组件“不确定不是函数”
我正在尝试将此组件从github导入我的代码:( https://github.com/ bibekg/react-schedule-selector )。但是,当我运行博览会时,它没有注册,并且我会收到此错误: undefined不是函数
这是我的代码:
import ScheduleSelector from "react-schedule-selector/src/lib";
export default function ({ navigation }) {
const [schedule, setSchedule] = React.useState([]);
return (
<Layout>
<TopNav
leftContent={<Ionicons name="chevron-back" size={20} color={"black"} />}
leftAction={() => navigation.navigate("Me")}
middleContent="Schedule"
/>
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text>https://github.com/bibekg/react-schedule-selector</Text>
<ScheduleSelector
selection={schedule}
numDays={5}
minTime={8}
maxTime={22}
hourlyChunks={2}
onChange={(val) => setSchedule(val)}
/>
</View>
</Layout>
);
}
另外,我已经运行npm nplas nplast instal react-我的计算机上的计划选择型组件!
关于为什么发生此错误以及如何解决该错误的任何想法?谢谢!
I am trying to import this component from github into my code: (https://github.com/bibekg/react-schedule-selector). However, it's not registering when I run expo and I get this error:
Undefined is not a function
Here is my code:
import ScheduleSelector from "react-schedule-selector/src/lib";
export default function ({ navigation }) {
const [schedule, setSchedule] = React.useState([]);
return (
<Layout>
<TopNav
leftContent={<Ionicons name="chevron-back" size={20} color={"black"} />}
leftAction={() => navigation.navigate("Me")}
middleContent="Schedule"
/>
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text>https://github.com/bibekg/react-schedule-selector</Text>
<ScheduleSelector
selection={schedule}
numDays={5}
minTime={8}
maxTime={22}
hourlyChunks={2}
onChange={(val) => setSchedule(val)}
/>
</View>
</Layout>
);
}
Also, I have already run npm install react-schedule-selector styled-components on my computer!
Any ideas on why this error is occurring and how to fix it? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该声明
不正确。您需要将其更改为以下内容。
这记录在此处。
The statement
is not correct. You need to change it to the following.
This is documented here.