react-desc icon indicating copy to clipboard operation
react-desc copied to clipboard

PropTypes.string.describe is not a function

Open lokimckay opened this issue 4 years ago • 0 comments

Following the README instructions to install and use this module results in the following error

TypeError: react_desc__WEBPACK_IMPORTED_MODULE_2__.PropTypes.string.describe is not a function

Reproduction steps

Repro repo: https://github.com/lokimckay-references/react-desc-26

  1. npx create-react-app myapp --use-npm
  2. cd myapp
  3. npm install react-desc
  4. Create Anchor.js file and copy + paste code snippet found in README
  5. In App.js, attempt to access the JSON output as described in readme
    import { AnchorWithSchema } from './Anchor';
    const documentation = AnchorWithSchema.toJSON();
    

Actual result

image

Expected result

JSON describing Anchor component PropTypes as per README

Versions

image

"dependencies": {
  "@testing-library/jest-dom": "^5.14.1",
  "@testing-library/react": "^11.2.7",
  "@testing-library/user-event": "^12.8.3",
  "react": "^17.0.2",
  "react-desc": "^4.1.3",
  "react-dom": "^17.0.2",
  "react-scripts": "4.0.3",
  "web-vitals": "^1.1.2"
},

lokimckay avatar Sep 01 '21 14:09 lokimckay