'How can i mock Pressable react native component?

I use Pressable in my component and my jest tests are responding with such errors:

  1. The above error occurred in the component
  2. Error: Unable to find node on an unmounted component

It's all because i use Pressable component, but if i remove it then test will work fine without errors



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source