atasmohammadi / react-native-multiple-select-list

Multiple select list with search bar
74 stars 46 forks source link

PropTypes shifted out of React #12

Open hitchcocknz opened 6 years ago

hitchcocknz commented 6 years ago

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

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

rsp8055 commented 6 years ago

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)

hitchcocknz commented 6 years ago

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.

swaroopgs commented 6 years ago

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

stanographer commented 6 years ago

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.

payalbaraiya commented 5 years ago

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

imran1992 commented 5 years ago

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'