react-native version of HTML script tag? - react-native

I need to use the methods of an eternal API in my native project.
If this were react I would just do
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"</script>
for example, I don't need bootstrap specifically.
Is there a way to do this in react-native?

You can use npm to manage your dependencies. Your react-native project should already be configured for this. You can install dependencies like this npm install --save my-react-native-module. Sometimes you will have to link them like this react-native link my-react-native-module. Most of those dependencies will write on their read me page how to install them.

Related

Material Icons seem to be missing a dependency - #emotion?

I am following the instructions / reference by google at mui.com, however when I try to use them I get an error by webpack saying I need something called #emotion.
Is this actually necessary and if so why is it not included when I install material icons.
npm install #mui/icons-material
There is no mention of it in the instructions by mui.com.
I blindly installed #emotion/react and #emotion/styled and webpack will compile. Seems that react requires extra dependencies not mentioned in the guide.
This syntax is used when you need icons in use from Material UI.
npm install #mui/icons-material
However, if you don't use icons in your project design, and you do use Material UI instead of CSS, you can install them with the following syntax:
npm install #mui/material #emotion/react #emotion/styled
However, judging by the warning package requirements mentioned by you, namely #emotion. Then you can install the package with the syntax:
npm install #mui/material #mui/styled-engine-sc styled-components
Material UI is using emotion as a styling engine by default. If you want to use styled-components instead.

Can i use native base without installing `react-native link`?

I want to use native-base but i do not want to install react-native link. How can i do this?
The reason i do not want to install react-native link is because react-native doc suggest us to delete react-native CLI globally.
I guess you have misunderstanding of what react-native link does. react-native link is an automatic way for installing native dependencies. read more here
In case of Native Base. This library is consist of other npm packages, so you need to install them in order to work properly with Native Base.
Native Base Docs states
Install Peer Dependencies
The peer dependencies included from any npm packages does not automatically get installed. Your application will not depend on it explicitly. read more here
If your react-native version is 0.60+ you do not need to link dependencies. All you need to do is install dependencies and you are good to do.

React Native Video

i'm trying to use 'react-native-video' in my application, i have used the following lines to get it:
npm install --save react-native-video
react-native link react-native-video (since my react native version is 0.59)
after doing so and using "Video" component from 'react-native-vide' i got an error like below:
what is the problem? what can i do? any ideas?
You did not link the library properly.
After having installed the library through npm i --save react-native-video, you'll need to run react-native link react-native-video in order to link it. This may or may not work - if it does not, you'll need to link manually according to the installation instructions of the library.
You might be using CocoaPods in which case you'll need to run these commands as well: cd ios && pod install
If you receive an error, you're most likely not using CocoaPods and this is the wrong approach.
Please note that you'll need to reinstall the app on the phone / simulator afterwards since you've changed the native dependencies. You'll also need to do this if you're using (ejected) Expo or anything alike. If you're using Expo with the managed workflow (= not ejected) you're not able to use libraries that depend on native linking.

Problem with new upgraded version(0.60) of react native when we linking any third party module

In my cases when i link third party module in react native like..
npm install react-native-vector-icons --save.
react-native link
It gives message for me....
React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:-
react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
but if i am not link the module it will not work for me
this problem occurs only in react-native new upgraded version(0.60) not for older version.
please suggest me any solution for the given problem.
Always make sure to install any third party library manually rather than doing react-native link.
Follow the detailed manual installation https://github.com/oblador/react-native-vector-icons from here.
Firstly run this command react-native unlink react-native-vector-icons
After unlink is successful, follow the manual installation steps.
Also it's better to use yarn (https://yarnpkg.com/en/) over npm while installing a package.
Hope this helps!
Since react native 0.60 auto-linking is avaliable so that means that future libraries release won't need to run the "link" command. If you're using vector-icons you'll need to wait until the upgrade. You can use the vector icons linked to you project normally, but be careful because that will not be compatible in the next major release in react native. I also tried to upgrade to react native 0.60.3, but this is not the great idea if your using a lot of dependencies.

How can I insert expo module in a React-native project?

I tried to use react-native-admob but It gives me a lot of problems. So I want to install with npm the expo module to use expoadmob that I'm sure works fine. I created a project with react native and tried to use "npm install expo --save" to add the expo module, but it didn't work. Anyone have a solution?
Not sure to understand.
You have 2 ways to create RN application expo-cli and react-native-cli.
You can't use expo for your module because you need to have a access to the native part (created with react-native-cli)
yarn add react-native-admob#next
AND don't forget to link the dependencies with
react-native link