Comments (7)
me too
from react-native-transformable-image.
@chrismcleod It dosn't work this way for me.
I've done this:
import React from 'react';
import PropTypes from 'prop-types';
...
import {Image} from 'react-native-transformable-image';
...
render....:
<Image
style={styles.detailImageAnfahrt}
source={{uri: data.picture_url}}
/>
Still got the same error. Any Idea?
BTW: The fork of dflourusso
works quite well: https://github.com/dflourusso/react-native-transformable-image
Install it via: yarn add https://github.com/dflourusso/react-native-transformable-image.git
, and all just work fine.
from react-native-transformable-image.
This is because PropTypes used to be defined in the React module, but has since been extracted to a separate module prop-types
Try this:
yarn add prop-types
then in a file that is required before all others:
const React = require('react');
React.PropTypes = require('prop-types');
Remeber that import
is hoisted, so in your bootstrap file, best to use all requires and no imports. For example this fixed this issue for me:
in ~/Project/index.js
// require React first
const React = require('react');
// Augment React module with PropTypes
React.PropTypes = require('prop-types');
// Now require our project files. At this point, all references to React will have React.PropTypes defined
const { AppRegistry } = require('react-native');
const { App } = require('./App');
AppRegistry.registerComponent("Project", () => App);
from react-native-transformable-image.
@chrismcleod Thank you,I got it.
from react-native-transformable-image.
@xstable you need to add "import PropTypes from 'prop-types';" in /node_modules/react-native-view-transformer/library/transform/ViewTransformer.js and change React.PropTypes to PropTypes
from react-native-transformable-image.
@chrismcleod It dosn't work this way for me.
I've done this:
import React from 'react'; import PropTypes from 'prop-types'; ... import {Image} from 'react-native-transformable-image'; ... render....: <Image style={styles.detailImageAnfahrt} source={{uri: data.picture_url}} />
Still got the same error. Any Idea?
BTW: The fork of
dflourusso
works quite well: https://github.com/dflourusso/react-native-transformable-image
Install it via:yarn add https://github.com/dflourusso/react-native-transformable-image.git
, and all just work fine.
the fork also works for me
from react-native-transformable-image.
@chrismcleod It dosn't work this way for me.
I've done this:
import React from 'react'; import PropTypes from 'prop-types'; ... import {Image} from 'react-native-transformable-image'; ... render....: <Image style={styles.detailImageAnfahrt} source={{uri: data.picture_url}} />
Still got the same error. Any Idea?
BTW: The fork of
dflourusso
works quite well: https://github.com/dflourusso/react-native-transformable-image
Install it via:yarn add https://github.com/dflourusso/react-native-transformable-image.git
, and all just work fine.
Just got the same issue and read the source code found out it imports another lib as below :
import ViewTransformer from 'react-native-view-transformer';
So you have to find this lib and refactor all React.PropTypes to PropTypes. And don't forget to import PropTypes from prop-types.
Hope this will help you
from react-native-transformable-image.
Related Issues (20)
- Can you publish new version to npm? HOT 2
- Image bounces back once touch is released HOT 4
- Android crash - getImageSize...error={"framesToPop":1,"code":"E_GET_SIZE_FAILURE"} HOT 8
- Images not shown when too large HOT 1
- cachable image HOT 1
- Not work method onSingleTapConfirmed
- Initial zoom
- Feature: Loading View
- Can this be used with the following package
- Update deprecated dependencies HOT 5
- What does enableTransform and enableTranslate props mean? HOT 1
- Cropping using this module? HOT 3
- using onViewTransformed callback to setState() in the parent component causes infinite loop
- Why is /Demo/ios/Demo in the Path
- Cannot install using yarn
- collected in excellent-RN-libs
- TypeError: undefined is not an object (evaluating '_react.default.PropTypes.bool')
- Cleanup non issue
- use with base64 image data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-transformable-image.