reactbook icon indicating copy to clipboard operation
reactbook copied to clipboard

Run whinepad 0.0.1 on the latest react

Open ekonoval opened this issue 8 years ago • 5 comments

Hey Stoyan, could you tell me please, how can I run examples from the folder whinepad v0.0.1. It says http://prntscr.com/h3gt2z Uncaught TypeError: Cannot read property 'arrayOf' of undefined at Object.33.react (bundle.js:21004)

I guess it's in some way related to the new version of react but my knowledge is not enough yet to fix it by myself. Or maybe could you advise how can I use old version using npm for examples of your book. Thanks in advance!

ekonoval avatar Oct 29 '17 13:10 ekonoval

Installing old version by

npm install [email protected] npm install [email protected]

seems working. Maybe would be useful for somebody

ekonoval avatar Oct 29 '17 13:10 ekonoval

There are a few issues I've solved, seemingly. in Excel, use new react prop-types: import PropTypes from 'prop-types'; that's the 'arrayOf' error. I"ve upgraded to ES6 classes, fix some uses of 'this', use a constructor, bind the event handlers to this, fix setState(), and set propTypes as a static member. Excel.js.txt

qwadzie avatar Nov 08 '17 19:11 qwadzie

also in button.js import PropTypes from 'prop-types'; rather than the destructuring assignment import React, {PropTypes} from 'react'; because the import is now (later version of React) moved into it's own separate component.

qwadzie avatar Nov 09 '17 14:11 qwadzie

@qwadzie Thanks for the solution!

Barendan avatar Jun 01 '18 23:06 Barendan

Tks @ekonoval this works for me. Just adding to it, maybe you may run the following commands in the repository again: npm install --save-dev babel-preset-react npm install --save-dev babel-preset-es2015

JonasTeixeira42 avatar Jan 08 '19 23:01 JonasTeixeira42