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