Skip to content

This package will provide a PhoneValidation component which validate different countries phone number as per maximum digits

License

Notifications You must be signed in to change notification settings

dws-ronak/react-native-phone-validation

Repository files navigation

react-native-phone-validation

This package will provide a PhoneValidation component which validate different countries phone number as per maximum digits

Installation

npm install react-native-phone-validation

Usage

import React, { useState } from 'react';
import { Button, SafeAreaView } from 'react-native';
import PhoneValidation, {
  checkPhoneValidation,
} from 'react-native-phone-validation';

const App = () => {
  const [country, setCountry] = useState();
  const [value, setValue] = useState();

  return (
    <SafeAreaView style={{ flex: 1 }}>
      <PhoneValidation setCountry={setCountry} setValue={setValue} />
      <Button
        title="Check"
        onPress={() => {
          const result = checkPhoneValidation(country, value);
          console.log(result);
        }}
      />
    </SafeAreaView>
  );
};

export default App;

Props

  • setCountry : will set the selected country from dropdown
  • setValue : will set the value entered in textinput

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

This package will provide a PhoneValidation component which validate different countries phone number as per maximum digits

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published