Cannot read property 'array' of undefined error occurring in my genymotion while running my react-native project - react-native

I recently upgraded an old project that was running in react-native 0.49 to 0.55. So after installing and running the project this pops up. I searched the internet and i did not found any solution. Please help.

Solved. For anyone like me facing this issue. Check your red box and you can see the module where the error is targeting. In my case it was DoctorTiming.js (Check the image in my question. One error is pointing towards it).
Go to that module check if it is importing from any dependencies.
If it does go to node_modules/your_dependency
Check for index.js.
Inside it change import PropTypes from 'react' to import PropTypes from 'prop-types'.
You are good to go after that.

Related

React Native 0.59 to 0.69 Post Upgrade Error - Facebook.React.Bridge Does Not Exist

After I upgraded React Native from 0.59 to 0.69, and dealing with some various errors, there is one last one I can't seem to solve..I noticed after running my react-native run-android command the following error:
/node_modules/react-native-splash-screen/android/src/main/java/org/devio/rn/splashscreen/SplashScreenModule.java:3: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
it actually generates about 20 errors, all mentioning various sub libraries beneath react.bridge. I've been quite stuck on what to do here and thought maybe I need to rewrite something.
The error references a splash screen module I was using (which I upgraded to the latest) located at: https://www.npmjs.com/package/react-native-splash-screen
Is com.facebook.react.bridge no longer used, or do I need to reinstall something and maybe the upgrade caused some sort of problem? I am using Android Studio (which I also had to upgrade) if that helps.
Thank you so much for any help you can provide!

SPFx webpart not working in IE11 - Reflect is undefined

I created a custom form using SharePoint Framework and pure JS, HTML and Sass. No React, Angular or any other frameworks. The form works perfectly in Chrome but when I try displaying it on IE (which we have to support), I get the following error:
Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details.
Technical Details
[SPLoaderError.loadComponentError]:
***Failed to load component "48a33395-b489-4696-b8ee-bcab3d186d5e"
Original error: ***Failed to load entry point from component "48a33395-b489-4696-b8ee-bcab3d186d5e" (AgileHumanaIntakeFormWebPart). Original error: 'Reflect' is undefined
I am using PNPJS so I made sure to import their polyfill package at the top and I also tried installing and importing core-js with no luck.
import "#pnp/polyfill-ie11";
import 'core-js/es/reflect';
From what I can see in other similar issues, 'Reflect' is used in React but as I mentioned I'm not using React in my webpart so I'm at a loss.
I would appreciate some help! Thanks in advance.

error when import snack project from github

when i try to use Import git repository in snack to edit my react native project this error is displayed : An error occurred during import. This could be because the data provided was invalid, or because the repository referenced is not a properly formatted Expo project.
my github link is : https://github.com/saeedjafary/SarvShop
I am seeing this error recently. there was no problem before
A late answer; but, to anyone faced this issue, click on Show Advanced Options in Branch name Specify the branch if it isn't the master, GitHub now uses main as the main branch.

React Native FBSDK Version messed up for IOS and Android

I have an issue regarding FBSDK package version on IOS and Android.
For Android, if I used the latest 0.6.0 version there is an error saying:
What went wrong: Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command
'/Users/admin/Library/Android/sdk/build-tools/26.0.0/aapt'' finished
with non-zero exit value 1
Now to sort this out I have to downgrade to 0.5.0 which works fine.
However in IOS, using the 0.5.0 version, I get an error saying:
FBSDKCoreKit/FBSDKCoreKit.h not found
So I Have to bump it up to 0.6.0 to sort this out which is working. I do not know how to align this version out. Any advice is much appreciated thank you.
Finally sorted out, I cloned the latest 0.6.1 version and modify the code so that it can work on RN0.43.3 on both android and ios.
Here are the steps:
After cloning/installing the latest version, go to your node_modules/react-native-fbsdk/js.
Open these files: FBLikeView.js, FBLoginButton.js,FBMessageDialog.js, FBSendButton.js, FBShareButton.js.
Change import PropTypes from 'prop-types'; to import React, { PropTypes } from 'react';
Under react native import change ViewPropTypes to View.
Change ...ViewPropTypes, to ...View.propTypes,.
Save the changes and done.
Note: You have to do this in all 5 files you opened.
So far it works in my end perfectly.
This solves the issue about:
'LikeView' has no propType 'RCTFBLikeView.onLayout' of native type
'boolean' if you haven't changed this

React Native - Error on importing third party library

I am trying to use a library react-native-tinder-swipe-cards - github
The issue is that it's giving the following error:
"Seems you're trying to access ReactNative.Component from the
'react-native' package. Perhaps you meant to access 'React.Component'
from the 'react' package instead?"
I am using the latest version of react native. Although the error tells me what exactly to do, it's not actually part of my application that is causing the error. It's their library that is causing the issue because removing this line:
import SwipeCards from 'react-native-swipe-cards';
Removes the error. Has anyone had a similar problem and can help me resolve this?
The NPM published version is not up to date with React Native and is using the "old" way to bring in Component (from 'react-native' instead of 'react'). Looking at the github repo the code has actually been updated but nothing has been published to NPM for that update. Your best bet is to either contact the author and get them to publish a update to NPM or use the repo version (npm i git+https//github.com/meteor-factory/react-native-tinder-swipe-cards --save)