You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MotionComponent initializes the MotionContext.Provider. Within MotionComponent, several initialization functions are executed, such as useCreateMotionContext (which consumes MotionContext), useVisualState (relying on makeUseVisualState that also consumes MotionContext), and useVisualElement.
However, there's a problem that might have been overlooked: accessing MotionContext is invalid since it occurs outside its designated boundary. Context values can only be accessed by its children.
The text was updated successfully, but these errors were encountered:
gurkerl83
changed the title
[BUG] MotionContext used outside of ProviderMotionContextPro
[BUG] MotionContext used outside of MotionContextProvider
Aug 7, 2023
@mattgperry While working with Framer Motion's source code over the past few weeks, I've delved into optimizing its feature loading behavior. Specifically, I've been examining the React-related components of Framer Motion, such as MotionComponent and useVisualElement, which are crucial for initiating the animation skeleton.
Since we cannot reproduce any error from the user's perspective, I request that we reopen the issue.
The MotionComponent initializes the MotionContext.Provider. Within MotionComponent, several initialization functions are executed, such as useCreateMotionContext (which consumes MotionContext), useVisualState (relying on makeUseVisualState that also consumes MotionContext), and useVisualElement.
However, there's a problem that might have been overlooked: accessing MotionContext is invalid since it occurs outside its designated boundary. Context values can only be accessed by its children.
The text was updated successfully, but these errors were encountered: