Javascript Function Is Not A Function React Native