I am making an app using react native version 0.29. I need an chart library for my android app. After embedding react-native-chart-android in my app I got the following error.
I got the answer for the problem. This library is written for below RN v 0.25. So they are using
import React,{ requireNativeComponent, Component, PropTypes, View } from 'react-native';
in their import statements. For RN updated version they should have import React and Component from react.
For that I will raise a PR in Github.
Related
I need a custom generic select picker for ios and android to react-native. How I'll develop a custom picker to use my all components.
You can create 2 files Select.android.js and Select.ios.js in your components folder (or something else) for each OS, and import your Select component by
import Select from 'components/Select'
Im following the documentation on the redux-persist github page but i dont know if they are for react native or not because im having issues with my imports. I am using Expo.
Heres what the documentation said you should use vs what i actually had to use:
import storage from 'redux-persist/lib/storage'
vs mine:
import storage from 'redux-persist/lib/defaults/asyncLocalStorage'
The next one i need to import is this
import { PersistGate } from 'redux-persist/integration/react'
However i cant figure out what file this is from at there is no 'integrations' folder.
Does anyone have any solution to this?
What makes you think that is not there? It is clearly part of the package as you can see here: https://unpkg.com/browse/redux-persist#6.0.0/integration/react/
Same for storage:
https://unpkg.com/browse/redux-persist#6.0.0/lib/storage/
I have developed one app in react native and ready to publish , but at the end while testing when I touch app with three fingers it is giving error which does not look to user, I am not able to solve it.
Well there is a temporary fix which worked for me
import {NativeModules} from 'react-native';
NativeModules.ExceptionsManager = null;
I use live template in Android Studio or IntelliJ with shortcut Ctrl + J which allow me to use live template like try catch block or just type iter or itar for iterating a list. I wish to use same in react native development in Visual Studio Code. Is this possible?
Yes we can get this feather using a snippet plugin link is here React native shippet
This plugin helps you to write code easily, for example, type imrc and press tab
import React, { Component} from 'react' //imrc
Following the document, I am including a toast in my projects:
import {ToastAndroid} from react-native
ToastAndroid.showWithGravity('A toast with gravity',ToastAndroid.SHORT,ToastAndroid.TOP);
But I got an error:
However, if I replace it with another function, it works:
ToastAndroid.show('A toast without gravity',ToastAndroid.SHORT);
I am using React Native 0.30.0
Is it a bug or I made the wrong way to use it.
ToastAndroid.showWithGravity(...) was implemented in ReactNative 0.31.0, upgrade your RN version.
First implemented here: v0.31.0-stable branch.