Email Validation (React Native). Returning the result as ‘invalid’ for all the entries

Ok I got the code working, below you can take the look for validating the email on each user input : Your function part: validate = (text) => { console.log(text); let reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w\w+)+$/; if (reg.test(text) === false) { console.log(“Email is Not Correct”); this.setState({ email: text }) return false; } else { this.setState({ email: text … Read more

componentWillMount is deprecated and will be removed in the next major version 0.54.0 in React Native

You should move all the code from the componentWillMount to the constructor or componentDidMount. componentWillMount() is invoked just before mounting occurs. It is called before render(), therefore calling setState() synchronously in this method will not trigger an extra rendering. Generally, we recommend using the constructor() instead. Avoid introducing any side-effects or subscriptions in this method. … Read more

react-native ios Podfile issue with “use_native_modules!”

Here is the correct answer: 1 – Your Podfile should contain this line on top require_relative ‘../node_modules/@react-native-community/cli-platform-ios/native_modules’ 2 – Make sure your package.json and node_module folders has this module installed cli-platform-ios/native_modules 3 – If you didn’t find after you run yarn install – means you have old cache node_modules in your machine and you need … Read more

Refresh previous screen on goBack()

Adding an Api Call in a focus callBack in the screen you’re returning to solves the issue. componentDidMount() { this.props.fetchData(); this.willFocusSubscription = this.props.navigation.addListener( ‘willFocus’, () => { this.props.fetchData(); } ); } componentWillUnmount() { this.willFocusSubscription.remove(); } UPDATE 2023: willFocus event was renamed to focus componentDidMount() { this.props.fetchData(); this.focusSubscription = this.props.navigation.addListener( ‘focus’, () => { this.props.fetchData(); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)