Skip to main content

Posts

Error: [Reanimated] valueUnpacker is not a worklet, js engine: hermes Fixed it with a version downgrade: npm install react-native-reanimated@3.4.2 And editing the babel.config.js file: module.exports = {   presets: ['module:metro-react-native-babel-preset'],   plugins: ['react-native-reanimated/plugin'], }; 
Recent posts
Splash screen still doesn't load first in React Native app Step 1 For android: /android/app/src/main/res/layout add an xml file called launch_screen.xml and have the code in it like that: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="match_parent"     android:layout_height="match_parent">     <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/gatepasssplash" android:scaleType="centerCrop" /> </RelativeLayout> Step 2 inside android\app\src\main\java\MainActivity.java add two lines on top as below: import android.os.Bundle; import org.devio.rn.splashscreen.SplashScreen; and add  public class MainActivity extends ReactActivity { @Override     protected void onCreate(Bundle savedInst...
Fetch not working in release APK - React Native Make sure your config.urlServer is not an HTTP endpoint but should be HTTPS. Latest RN versions target recent Android SDK that blocks insecure HTTP connections automatically. Quick Fix: Adding android:usesCleartextTraffic="true" in <application> tag in android\app\src\main\AndroidManifest.xml will work.
 react native vector icons won't show in android device Open android/app/build.gradle and add the following: apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

OTP verification 2 minutes count down timer

Java Script  let timerOn = true; function timer(remaining) {   var m = Math.floor(remaining / 60);   var s = remaining % 60;   m = m < 10 ? '0' + m : m;   s = s < 10 ? '0' + s : s;   document.getElementById('timer').innerHTML = m + ':' + s;   remaining -= 1;   if(remaining >= 0 && timerOn) {     setTimeout(function() {         timer(remaining);     }, 1000);     return;   }   if(!timerOn) {     // Do validate stuff here     return;   }   // Do timeout stuff here   alert('Timeout for otp'); } // Then Call the function of Timer // timer(120); HTML <input type="text" name="otp" placeholer="Enter your otp"/> <div>Time left = <span id="timer"></span></div>

How to Get Current Date & Time in React

useEffect(() => { const dateString = Date.now()     const formatDate = (dateString) => {       const options = { year: "numeric", month: "long", day: "numeric"}       return new Date(dateString).toLocaleString(undefined, options)     }     alert(JSON.stringify(formatDate(dateString))) }, []) ------------------------------------------------------------------------------------------------------------------ If don't want to use options and just want to use dd/mm/yyyy format then use below code. const dateString = Date.now()     const formatDate = (dateString) => {       return new Date(dateString).toLocaleString('en-GB')     } alert(JSON.stringify(formatDate(dateString)))
 How can I validate I have drawn something in jSignature panel or not? if( $sigdiv.jSignature('getData', 'native').length == 0) {     alert('Please Enter Signature..');  } Note:   $sigdiv variable must be change as per your JSignature container variable