liowebrtc
liowebrtc copied to clipboard
Peer.Nick Always Undefined
The peer.nick
value always returns undefined, even though it's present in the Peer object. For instance, I pass a nickname to the Liowebrtc component as shown below:
<LioWebRTC
options={{ debug: true,
dataOnly: true,
nick: "Pippin" }}
onReady={join}
onCreatedPeer={handleCreatedPeer}
onReceivedPeerData={handlePeerData} >
If I print the peer
object to console in handleCreatedPeer
, I can see peer has a nick with value "Pippin." However, trying to call peer.nick
or peer["nick"]
always produces undefined.
For instance,
console.log("Peer id: ", peer.id); // valid value
console.log("Peer nick: ", peer.nick); // undefined
console.log("Peer one: ", peer.oneway); // valid value
even though:
If I call `Object.keys()` on Peer, I get
As you can see, nick
is missing, even though it's there when you log the object in its entirety.