Error when using component npm? - react-native

I'm trying to use an npm library in my react-native app. but I have this error
I'm using cielo library
and I'm importing to my project
import cielo from 'cielo';
Can someone help me?

Look at github source code of this package here.
It seems you have to pass some parameter when importing this package. You can take a look at usage example of this package here. Your import code seems to be wrong...

Related

What package does create-react-app docs use

I am wondering how I can create a docs site like create-react-app or react typescript cheatsheets. I am imaging they are using the same package or setup, I just want to know what they are using. Apologies if the answer is too obvious!
After some investigation I discovered they are using docusaurus.

VsCode Intellisense react native not working

I am facing the problem. I am not getting intellisense of properties onPress onLongPress, paddingHorizontal, paddingVertial even in import when I type Touch then expected Suggestion will be Touchable, TouchableOpacity etc no any suggestion working in react native in vscode.
If anyone still look for a solution,
here, install this npm package #types/react-native by typing in terminal:
npm install --save #types/react-native
This is where I found the solution
So i found an easy solution to this. All you have to do is change your language mode from JavaScript to JavaScript React.
But that only fixes the auto complete issue, to also fix the auto import you can install this vs code extension called npm Intellisense by Christian Kohler.
Link: https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense
You will need to install an extension in VsCode to get that functionality.
vscode-react-native
To install and use the extension, just follow the steps provided from that github repository.
Happy coding!

Twilio import error: Module cannot be null

I've done npm install --save react-native-twilio and react-native-link in my EXPO react-native project. the code compiles without error. But when I add this line of code:
const Twilio = require('react-native-twilio');
in my file, it reports an error says Module can not be null.
I think it is because I didnt link my twilio library to the project right, but I dont know how to fix it, can someone give me some help?
It looks like react-native-twilio has native dependencies and with EXPO, its not possible to include custom native modules. The only way is for you to eject your app to create native builds.
[Official docs for ejecting] (https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#ejecting-from-create-react-native-app)

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)

How to determine if npm package is compatible with react-native?

Is there a way to determine if a npm package is compatible with react-native ?
I read that to be usable in react-native they must have polyfill. Is this something I can look for?
For example:
https://www.npmjs.com/package/redux-persist
I am learning react-native and javascript. I was hoping to take advantage of the many existing npm packages. However unless the package has "react-native" as part of the package name it does not seem to work.
Thanks in advance,
UPDATE (8/7/2017): Have a look at Andre Staltz's (staltz/react-native-node) package which makes ALL node packages work with react native!
As I understand it, any package that is (( NOT )) DOM dependent, should work. With regard to the rt2zz/redux-persist package, I only quickly looked it over but it appears as though they support the react-native store since they provide instructions for it.
import {AsyncStorage} from 'react-native'
persistStore(store, {storage: AsyncStorage})