Check out example codes for "check if intent has extras". It will help you in understanding the concepts better.

Code Example 1

Intent intent = getIntent();

if (intent.hasExtra("bookUrl")) {
    bookUrl = b.getString("bookUrl");
} else {
   // Do something else
}

Learn ReactJs, React Native from akashmittal.com