I want build a multi-page website running on a localhost which can go from one page to another with a react-native mobile app(also running on a localhost server). I am planning to use PeerJS for the communication and understand how signaling works.
peer.on('connection', (conn) => {
conn.on('data', (data) => {
this.setState({
//this is when I receive data from the connection,
//where I probably want to redirect to a different page??
});
});
});
I see many resources that use a website button click to move from one page to another, but I am not sure how I can automatically go from one page to another with the mobile app signal. Any advice appreciated.