meteor-factory / react-native-tinder-swipe-cards

Tinder-like swipe cards for your React Native app
MIT License
1.13k stars 301 forks source link

Crashes on react native ^0.49.1 #106

Open 1mike12 opened 7 years ago

1mike12 commented 7 years ago

When upgrading from .47 to .49 I get

ExceptionsManager.js:65 Cannot read property 'array' of undefined 

handleException | @ | ExceptionsManager.js:65
-- | -- | --
  | handleError | @ | InitializeCore.js:106
  | reportFatalError | @ | error-guard.js:46
  | guardedLoadModule | @ | require.js:125
  | _require | @ | require.js:110
  | accept | @ | require.js:285
  | (anonymous) | @ | /screens/HelpableSes…ryModuleOnly=true:1
  | (anonymous) | @ | HMRClient.js:121
  | activeWS.onmessage | @ | HMRClient.js:101
  | dispatchEvent | @ | event-target.js:172
  | (anonymous) | @ | WebSocket.js:228
  | emit | @ | EventEmitter.js:181
  | __callFunction | @ | MessageQueue.js:306
  | (anonymous) | @ | MessageQueue.js:108
  | __guard | @ | MessageQueue.js:269
  | MessageQueue.callFunctionReturnFlushedQueue | @ | MessageQueue.js:107
  | (anonymous) | @ | debuggerWorker.js:72
e6a5 commented 7 years ago

I have the same problem as you undefined is not an object (evaluating '_react3.default.Proptypes.arrray)

then I fixed this problem here https://reactjs.org/blog/2017/04/07/react-v15.5.0.html

1mike12 commented 7 years ago

Not sure how I fixed this, but probably blowing away node_modules would work and re-installing. @tranhiepqna what specifically fixed the problem? By upgrading to react 15.5?

ignaciosantise commented 7 years ago

@tranhiepqna @1mike12 I solved it in this Pull Request! check it out! I dont know if this project is still maintained, if not, you could fork it and make the change in your own 😄 Hope it helps!

Im using it in React Native 0.49.1

PR: https://github.com/meteor-factory/react-native-tinder-swipe-cards/pull/108

juananime commented 7 years ago

I could find the way to make it work in RN 0.49+. From RN 0.49 the object PropTypes belong to prop-types instead of React. Just import the porper package import PropTypes from 'prop-types';

And replace all the static propTypes: Instead of React.PropTypes is PropTypes So in SwipeCard.js locate static propTypes = { cards: React.PropTypes.array, ... } and change it for:

static propTypes = { cards: PropTypes.array, .... }

Cheers