Code Monkey home page Code Monkey logo

Comments (7)

zk6859 avatar zk6859 commented on July 3, 2024 1

me too

from react-native-transformable-image.

xstable avatar xstable commented on July 3, 2024 1

@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.

chrismcleod avatar chrismcleod commented on July 3, 2024

@uguryiilmz @zk6859

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.

zk6859 avatar zk6859 commented on July 3, 2024

@chrismcleod Thank you,I got it.

from react-native-transformable-image.

MihailShab avatar MihailShab commented on July 3, 2024

@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.

iffj avatar iffj commented on July 3, 2024

@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.

chaosuperDK avatar chaosuperDK commented on July 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.