grommet / grommet/react-desc

PropTypes.string.describe is not a function

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/14341953/131684482-e0f20070-3908-4908-bcba-55c2ac5c7b6a.png)

# Expected result

JSON describing Anchor component PropTypes as per README

## Versions

![image](https://user-images.githubusercontent.com/14341953/131685816-f1e518fa-4cca-4ec1-97d3-dd9fd40c6ca1.png)

```
"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"
},
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.