Check out example codes for "eosio check account exist". It will help you in understanding the concepts better.

Code Example 1

check(is_account("accountname"_n),"Account not fount");

Learn ReactJs, React Native from akashmittal.com