If you’re using
createAchievements(), you should use the returned Provider component instead, which has the engine already bound.Signature
Parameters
The achievement engine instance created with
createAchievements() from the core package.React children that will have access to the achievement engine via hooks.
Example
Using the factory’s bound Provider (recommended)
Using AchievementsProvider directly
Notes
- All achievement hooks must be used within an
AchievementsProvideror the factory’sProvider - The provider uses React Context to distribute the engine instance
- If hooks are used outside a provider, they will throw an error: “useEngine must be used inside AchievementsProvider”
