react-native-root-tips
react-native-root-tips copied to clipboard
Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`
https://reactnative.dev/blog/2017/02/14/using-native-driver-for-animated#how-do-i-use-this-in-my-app
This problem occurs when you want to use the version that is installed by default of this library. Inside the code of /node_modules/react-native-root-tips/lib/ToastContainer.js there are 2 functions:
_show _hide
Both require the useNativeDriver option:
Lines can be added but every time / node_modules is updated via yarn or npm the changes will disappear.
However, as the library is relatively small and simple, I recommend incorporate it into the main code of your application.
Just copy the /lib, /src folders and index.js file...
Paste the files in a folder called /toast (or whatever you like to call) inside your application structure ...
And now import Tips from the folder where index.js is hosted (it is not necessary to include index in the path)...
Now you can add: useNativeDriver: true useNativeDriver: false useNativeDriver: Platform.OS === 'XXX' ? true : false Depending on what you need.
I only recommend this workaround in simple libraries and for very practical cases like this while the version with corrections is released. To not have volatile code modified in / node_modules.
Note: You can also delete the example.gif file to save space.