how to use React-Native-Image-Picker? - reactjs

I am trying to use React-Native-Image-Picker. My question is that, is it necessary to eject the project to properly link this particular module. If no, does somebody know a link to a tutorial which can help me setup the module.

You will need to eject to use a library requiring you to link. Enter npm run eject to eject the app. Once you eject, you will be able to link your library.
Ejecting from create-react-native-app
On a side note, I would recommend using Expo. Expo is similar to create-react-native-app, is more GUI-oriented. Expo also has an image picker as well as a lot of great apis you can use so you won't have to eject.
CRNA vs Expo

Related

Using Expo React Native in Monorepo without Yarn

I have been trying to setup a monorepo using turborepo. I want to have a Nextjs application along with a React Native application (using Expo).
I have come as far as getting everything to work using yarn and it's no-hoist options as well as expo-yarn-workspaces. You can see my repo here: https://github.com/juliusmarminge/turbo-expo-next-starter. This is my first monorepo so not sure if it follows conventions by any means.
The issue I'm getting into is I don't want to be forced to use Yarn, especially since pnpm is getting more popular and I use it for most my other projects. Has anyone any experience in using Expo in a monorepo without using Yarn? Feels like all examples online is using it...
Thanks in advance,
Julius
You can use it with pnpm AND get-workspaces (from yarn) to update your metro.config.js and to resolve node_modules.

How can i run reactjs locally on mac other than the npx create-react-app?

I'm just a bit annoyed by having to do npx create-react-app and wait then delete most of the files and code.
I've seen some people use npm i react react-dom, is this another way as well?
can i also use react offline ?
You can add a in your html if you don't want to use create-react-app. Then just create a file with that name. Otherwise I believe other methods still give you a boilerplate.
Even if without create-react-app, can make React applications. But it's bother than with it. create-react-app just automates downloading libraries and many many configurations. So what they do is same.
Create react app creates spa and gives entire folder structure out of the box, but you don't always need to use cra command for that, you can create spa yourself with minimal packages if you know the actual working of spa, you can use react, webpack, webpack dev server, babel.

I cannot find anything on setting up One signal in Expo

I am very new to react native development. I am using Expo for development. I need One signal for push notification in IOS and Android but I cannot find proper information on it. Can someone please help me on this.
That is because Expo doesn’t support OneSignal
From the first page of the OneSignal documentation for react-native
If you are building an Expo project, please note that we have recently
updated the SDK so that it will no longer crash when you add OneSignal
as a dependency inside Expo's development environment. However, please
note that until you detach from Expo and link OneSignal's native SDK's
(along with React Native's own dependencies), any calls to OneSignal
functions will be unused.
If you want to use OneSignal you will have to eject your Expo app.
You can eject by running expo eject in the terminal.

Remove expo from react native

I've had so many troubles with the tool, I seriously have been debugging expo morethan the app itself.
How might I remove expo completely from CRNA? I would like to use CRNA and it's debugging tools without expo
You can do it by ejecting your app running npm run eject
Then, if you have any reference to expo just remove all of them.
your app modules before being ejected looks like this below:
When you run npm run eject it will ask some questions like:
be sure to select React Native: I'd like a regular react Native project
And your folders will now look like this (no expo):
Just be careful because ejecting is a permanent process, you should make a backup of your files.
Once you eject from Expo, though, and if you're using a Windows computer, you'll only be able to develop for Android, I believe. You'll still need a Mac to work in React Native without Expo. I'm a beginner but just wanted to highlight this difficulty faced by Windows users when ejecting from Expo.

Creating a UI component library with react-native for android apps

I want to use my UI components as a reusable seperate repo/project for my react-native iniit App.
So i creatd a seperate project folder like this
and installed these dependencies
and few dependencies externally with my other app.
Then i used
yarn link
to link this project to my working app as a module just like a node module. but i get this error when i try to run my app?
Is there an issue with my method, or is there a sure way i can try to reach my goal because i found multiple ways and various configuration of creating such component libraries.but i didn't use any since the end goal is different.
This is a known issue with the React Native packager. See this discussion: https://github.com/facebook/react-native/issues/637.
This may have to do with using watchman, although there seem to be a few different cases where this can crop up.
TL;DR: React Native packager does not respect symlinks to projects, so npm and yarn link do not work like you would expect them to. Apparently this is being resolved in metro-bundler: https://github.com/facebook/metro-bundler/issues/1.
Unfortunately the workarounds are not that pretty, but there are a few options discussed in the issue 637 discussion. It also looks like you may be using a github repo for your package.
You could tell npm to get your library from github via your project's package.json, so you probably do not need npm link, though you will not be able to link to your local files for your module this way.

Resources