![](/img/trans.png)
[英]Mutating an array present in one .js file from another .js file in react-native
[英]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
如果您想將其作為默認值導入,就像您對import kurals from './kurals';
,那么它必須默認導出:
export default [];
由於您使用export const kurals = [];
導出了它那么它是導出的 object 的屬性,您需要對其進行解構:
import { kurals } from './kurals';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.