[英]i try to import a array data in JS file from another js file in react native , and i try to check the length of the array in react native
If you want to import it as a default, like you did with import kurals from './kurals';
如果您想将其作为默认值导入,就像您对
import kurals from './kurals';
, then it must be exported as default: ,那么它必须默认导出:
export default [];
Since you exported it with export const kurals = [];
由于您使用
export const kurals = [];
导出了它then it's a property of the exported object and you need to destructure it:那么它是导出的 object 的属性,您需要对其进行解构:
import { kurals } from './kurals';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.