【发布时间】:2021-06-09 14:55:04
【问题描述】:
在使用原生 android 创建桥后,我试图访问从 NativeModule 收到的结果之外的状态。数据显示在console.log中,但外部无法访问。
NativeModules["GetapplistModule"].getNonSystemApps(res => {
var pairs = [];
for(var key in res){
var obj = JSON.parse(res[key]);
pairs.push(obj);
}
const [AppData] = React.useState(pairs);
});
type AppProps = React.ComponentProps<typeof AppProps>;
export const notificationTweets: Array<AppProps> = {AppData};
【问题讨论】:
标签: react-native bridge