When installing React Native Testing Library on an Expo project (uses React 18) I get an error - react-native

I have an Expo App (the last expo which uses React 18) that I want to run some testing on
But when trying to install React Native Testing Library, I get this error:
I wonder if this error means that it is incompatible with React 18
What do you suggest me to do?
Thanks in advance
Rafael

I solved the problem by using:
npm install --save-dev #testing-library/react-native --legacy-peer-deps

Related

Expo React Native Detox Testing

I have a Expo React Native where I need to do some end to end testing.
Im following this tutorial:
https://blog.expo.dev/testing-expo-apps-with-detox-and-react-native-testing-library-7fbdbb82ac87
I need to install the following library:
npm install --save-dev react-native-testing-library
And after I install it I get this message:
npm WARN deprecated react-native-testing-library#6.0.0: 🚨 react-native-testing-library has moved to #testing-library/react-native. Please uninstall react-native-testing-library and install #testing-library/react-native instead, or use an older version of react-native-testing-library. Learn more about this change here: https://github.com/callstack/react-native-testing-library/issues/442. Thanks! :)
Does anyone how to use Detox with #testing-library/react-native or any link to a tutorial?
Thanks a lot

Struggling to set up nativebase in a React Expo project

I have tried so many different ways to set nativebase up with expo and am still having an issue. At the moment I'm using the
Getting Started documentation found on the nativebase website.
I first create a new app with expo using
expo init myapp
Then I install nativebase using
npm install native-base --save
Then I finally install the font
expo install expo-font
I even copy the App.js found in the getting started documentation, and after I start the app and try to run it on an emulator I face the below error
Unable to resolve "#expo/vector-icons/Fontisto" from "node_modules\native-base\dist\src\basic\IconNB.js"
Failed building JavaScript bundle.
What am I missing? Coming from .NET world this whole process with dependencies is so painful...
*Edit 1
I'm sure someone will make mention of the fact that the error message mentions #expo/vector-icons and I have not installed that. When running before I install this package I get that error, and after I install the mentioned package I still face the exact same error.
Please try with this version of native base :
npm i --save-exact native-base#2.13.8
Expo should release a version with that version .
Hope it helps. feel free for doubts
We can run the below command with Expo
npm i --save-exact native-base#2.13.8
Still this version is not available, but its working, really don't know why?

React Native 'expo-asset requires expo-file-system package to be installed and linked' ERROR

I run my react native on android simulator and I got this error:
expo-asset requires expo-file-system package to be installed and linked
On iPhone its works fine and there is not error.
Thanks
According to this post
https://github.com/expo/expo/issues/3027
you should run the following command:
npm install react-native#0.55.2

How to install native base in expo project?

I tried many ways to install native base in expo project
I was thinking this command will work
$ npm install native-base --save
but I can install native base in react native with this command
After you follow the quick start here
you have to follow Setup with CRNA steps to create React Native project using the CRNA cli.
I think you missing Install #expo/vector-icons step here.
I've created native-base working with expo environment named "expo-base".
You can check this out from here :-)
https://github.com/Dibyasundar444/expo-base

React-native-camera error with Expo: undefined is not an object (evaluating 'CameraManager.Aspect')

I cannot seem to get react-native-camera working in Expo. Here is a screenshot of the error I am receiving:
The error originates on line 62 of react-native-camera index.js which is calling NativeModules.CameraManager. Does this have something to do with expo not having access to some native APIs?
Steps already taken:
react-native link react-native-camera
watchman watch-del-all
rm -rf node_modules && npm install
rm -fr $TMPDIR/react-*
npm start -- --reset-cache
Restarting the build
I also created a regular react native app via react-native init and was able to properly set up react-native-camera without any issues.
I reached out to the Expo team directly and this was the response I received:
custom native modules are not supported in expo unless you eject
see the sdk api reference section of docs to see what native apis we
expose https://docs.expo.io/versions/v16.0.0/index.html
Answer from expo
You have to use the expo camera from:
import { Camera, Permissions } from 'expo';
Take a look at:
https://docs.expo.io/versions/latest/sdk/camera.html
As I understand, you want to use the camera with Expo.
In this case you can use the Expo Camera package with comes with the Expo API
SDK API ReferenceCamera:
https://docs.expo.io/versions/latest/sdk/camera.html
As background info - Expo and native modules: React-Native is able to
use native app code and access native features, but it needs to be
'linked' via the native app code e.g. the POD file. In the case of
Expo, the native app is already written and only executes your React
Native code. With Expo, linking is only possible when you 'eject' or
'detach' from the original code, which does only make sense in some
cases.