react-native-multiple-select-list icon indicating copy to clipboard operation
react-native-multiple-select-list copied to clipboard

PropTypes shifted out of React

Open hitchcocknz opened this issue 6 years ago • 6 comments

As of React 16.0.0, react module no longer contains PropTypes.

Need to change to import PropTypes from 'prop-types';

hitchcocknz avatar Mar 30 '18 08:03 hitchcocknz

Updated the import statement as above but still getting an error : Cannot read property 'oneOf' of undefined ExceptionsManager.js:65 Module AppRegistry is not a registered callable module (calling runApplication)

rsp8055 avatar Mar 31 '18 05:03 rsp8055

import PropTypes from 'prop-types'; is the correct import statement. Have you ensured the "prop-types" module was installed i.e. npm install --save prop-types.

When I modified the code most of it was in the react-native-vector-icons code that sits under react-native-multiple-select-list code in node_modules.

hitchcocknz avatar Mar 31 '18 18:03 hitchcocknz

Added prop-types. Still getting the error - Cannot read property 'proptypes.oneOf' of undefined.

swaroopgs avatar Jun 28 '18 10:06 swaroopgs

I fixed this temporarily by manually changing (in multiSelect.js):

import React, { Component, PropTypes } from "react";

to

import React, { Component } from "react"; import PropTypes from "prop-types";

Then changing:

import Icon from 'react-native-vector-icons/Ionicons';

to

import Icon from 'react-native-vector-icons/dist/Ionicons';.

I'm using react-native-vector-icons v4.6.0.

stanographer avatar Jul 06 '18 18:07 stanographer

I fixed this temporarily by manually changing (in multiSelect.js):

import React, { Component, PropTypes } from "react";

to

import React, { Component } from "react"; import PropTypes from "prop-types";

Then changing:

import Icon from 'react-native-vector-icons/Ionicons';

to

import Icon from 'react-native-vector-icons/dist/Ionicons';.

I'm using react-native-vector-icons v4.6.0.

why dont lib maintainer resolve this issue

payalbaraiya avatar May 11 '19 08:05 payalbaraiya

I fixed this temporarily by manually changing (in multiSelect.js):

import React, { Component, PropTypes } from "react";

to

import React, { Component } from "react"; import PropTypes from "prop-types";

Then changing:

import Icon from 'react-native-vector-icons/Ionicons';

to

import Icon from 'react-native-vector-icons/dist/Ionicons';.

I'm using react-native-vector-icons v4.6.0.

You Did ok for PropTypes. But for VectorIcons it should be like this: import {Ionicons as Icon } from 'react-native-vector-icons'

imran1992 avatar May 11 '19 10:05 imran1992