Creating an ECS
#
useECS HookEvery time you use react-ecs, you need create an ECS instance. That's easy with the useECS hook:
#
ECS.ProviderECS is used by everything.
To make it available, utilize the React Context tucked away in the ECS.Provider attribute:
#
Driving the ECSThe System functions you use are called every time that ECS.update is called. An easy way to do that is with the useAnimationFrame hook: