admin管理员组文章数量:1400087
I'm a second year IT student and I'm building a mobile student app that will have this feature where users (students) can upload a single pdf file. I have only spent 2 weeks with React Native.
So, I got this code (Body.tsx) and it doesn't work:
import { StyleSheet, View, Button } from "react-native";
import DocumentPicker from 'react-native-document-picker';
import React from "react";
function Body() {
const pickDocument = async () => {
try {
const result = await DocumentPicker.pick({
type: [DocumentPicker.types.pdf],
});
console.log(result);
} catch (err) {
if (DocumentPicker.isCancel(err)) {
console.log('User canceled the picker');
} else {
throw err;
}
}
};
return (
<View style={styles.container}>
<Button title="Upload" onPress={pickDocument}/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
export default Body;
All I get is this error: enter image description here
"Server Error Cannot read properties of undefined (reading 'getEnforcing') Call Stack factory app/Body.tsx"
I use expo, I don't know why but that's what we were taught.
本文标签:
版权声明:本文标题:reactjs - Problem with my mobile app project feature (so users can upload pdf file to be parsed into json) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744247658a2597097.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论