0

Following the document, I am including a toast in my projects:

     import {ToastAndroid} from react-native

    ToastAndroid.showWithGravity('A toast with gravity',ToastAndroid.SHORT,ToastAndroid.TOP);

But I got an error:

enter image description here

However, if I replace it with another function, it works:

   ToastAndroid.show('A toast without gravity',ToastAndroid.SHORT);

I am using React Native 0.30.0

Is it a bug or I made the wrong way to use it.

Klyment
  • 187
  • 1
  • 2
  • 11

1 Answers1

0

ToastAndroid.showWithGravity(...) was implemented in ReactNative 0.31.0, upgrade your RN version.

First implemented here: v0.31.0-stable branch.

DSquare
  • 2,458
  • 17
  • 19