我将参数从屏幕 A 传递到屏幕 B
屏幕 A:
<Button
title="Go Next"
onPress={() =>
navigate('liveScreen', {
linkItem: this.state.link,
})
}
/>
屏幕 B:
import React, { useEffect } from 'react';
import JitsiMeet, { JitsiMeetView } from 'react-native-jitsi-meet';
function linkScreen() {
useEffect(() => {
setTimeout(() => {
const url = `https://meet.jit.si/${this.props.navigation.state.params.linkItem}`;
const userInfo = {
displayName: 'User',
email: 'user@example.com',
avatar: 'https:/gravatar.com/avatar/abc123',
};
JitsiMeet.call(url, userInfo);
}, 1000);
}, [])
useEffect(() => {
return () => {
JitsiMeet.endCall();
};
});
function onConferenceTerminated(nativeEvent) {
console.log(nativeEvent)
}
function onConferenceJoined(nativeEvent) {
console.log(nativeEvent)
}
function onConferenceWillJoin(nativeEvent) {
console.log(nativeEvent)
}
return (
<JitsiMeetView
onConferenceTerminated={e => onConferenceTerminated(e)}
onConferenceJoined={e => onConferenceJoined(e)}
onConferenceWillJoin={e => onConferenceWillJoin(e)}
style={{
flex: 1,
height: '100%',
width: '100%',
}}
/>
)
}
export default linkScreen;
但屏幕 B 上显示“未定义不是对象(正在评估 '_this.props.navigation')”的错误
我使用 react-native-jitst-meet 为班级项目创建简单的会议应用程序。真心希望各位大神给个解决办法。之前谢谢你