react-native-cacheable-image | Image Component for React Native | Caching library
kandi X-RAY | react-native-cacheable-image Summary
kandi X-RAY | react-native-cacheable-image Summary
An Image Component for React Native that will cache itself to disk.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-native-cacheable-image
react-native-cacheable-image Key Features
react-native-cacheable-image Examples and Code Snippets
npm install react-native-fs --save # install react-native-fs
react-native link react-native-fs #link native module
npm i react-native-cacheable-image --save
import CacheableImage from 'reac
Community Discussions
Trending Discussions on react-native-cacheable-image
QUESTION
I'm trying to get this library working: https://github.com/gcanti/tcomb-form-native
However when I run it on my local machine I get the error: undefined is not a function (near '...React.createClass...')
The only hint that I could find is here: https://github.com/jayesbe/react-native-cacheable-image/issues/60 where someone stated that React 16 removed createClass.
When I follow the steps here https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-reactcreateclass
I get an error involving promises. I'm not too clear how to use this library and would appreciate some guidance.
edit: the example code:
...ANSWER
Answered 2018-Oct-30 at 21:21What happens when you try this instead?
(PS this is so old school... I probably suggest not using this library at all)
QUESTION
The app crashes immediately only when opened on device. It runs fine on a Genymotion simulator but when running it on a Note 2 and a galaxy S7 it crashes immediately. Logcat shows this error:
com.facebook.react.common.JavascriptException: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's
rendermethod, or you have multiple copies of React loaded
I've removed all duplicate imports in MainApplication.java
, I've tried upgrading react to 0.40, running watchman watch-del-all
, deleting the node_modules
folder, and running npm cache clean
but nothing seems to help
EDIT
I just created a new project and I'm getting the same error on device. What could be causing this? Never mind, I deleted the app on the device and reinstalled and now the new project opens fine.
Here's my package.json
:
"name": "DineSafe",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"parse": "1.9",
"parse-react": "^0.5.2",
"react": "15.4.0",
"react-native": "^0.40.0",
"react-native-animatable": "^1.1.0",
"react-native-cacheable-image": "^1.4.3",
"react-native-global-props": "^1.0.7",
"react-native-image-crop-picker": "^0.11.1",
"react-native-keyboard-spacer": "^0.3.1",
"react-native-progress": "^3.1.0",
"react-native-svg": "4.4.0",
"react-native-triangle": "0.0.6"
},
"jest": {
"preset": "jest-react-native"
},
"devDependencies": {
"babel-jest": "17.0.2",
"babel-preset-react-native": "1.9.0",
"jest": "17.0.3",
"jest-react-native": "17.0.3",
"react-test-renderer": "15.3.2"
}
ANSWER
Answered 2017-Jan-14 at 21:18I got it where your problem stems from. Sometimes, when you install third party APPs, those third party APPs reinstall react in your project and those duplicate versions are causing this error.
According to your package.json
you are implementing some lib that works fine in a simulator or emulator, but crashes when running the APP on a device.
Solution: go to the node_module
folder of every third party APP that you have installed and search for react. After that, remove that lib by using the npm uninstall lib_name
command and run the project.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-cacheable-image
For react-native-fs. You need to link the module. Either try rnpm link react-native-fs or react-native link react-native-fs. See react-native-fs for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page