fix: initial add

This commit is contained in:
cha0s 2021-02-13 08:24:14 -06:00
parent b274e4f9bb
commit 208bfd9712

View File

@ -37,6 +37,7 @@ const Play = () => {
entity.parentNode = ref.current.querySelector('.entities'); entity.parentNode = ref.current.querySelector('.entities');
} }
}; };
Object.values(room.entities).forEach(onEntityAdded);
room.on('entityAdded', onEntityAdded); room.on('entityAdded', onEntityAdded);
return () => { return () => {
room.off('entityAdded', onEntityAdded); room.off('entityAdded', onEntityAdded);