joshwcomeau / joshwcomeau/react-collection-helpers

oneOfType Error

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
105
Forks
3
PR merge metrics
No merged PRs in 30d

Description

After fresh install of any one of the following versions tried, **v1.2.2**, **v1.2.1** & **v1.1.0**, I'm getting the following in console.

```
Uncaught TypeError: Cannot read property 'oneOfType' of undefined
at eval (BaseCollectionHelper.js?eabe:29)
at Object. (bundle.js:11178)
at __webpack_require__ (bundle.js:50)
at eval (index.js?ac6a:1)
at Object. (bundle.js:347)
at __webpack_require__ (bundle.js:50)
at eval (index.js?75c9:1)
at Object. (bundle.js:11171)
at __webpack_require__ (bundle.js:50)
at eval (AdminUsers.js?eec1:9)
```

In source file....

```
BaseCollectionHelper.propTypes = {
children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired, <----- This line...
elementType: PropTypes.oneOfType([PropTypes.string, // For native nodes (eg. 'div')
PropTypes.func]).isRequired,
collection: PropTypes.array.isRequired
};
```

Any ideas here of what's going on?

Contributor guide

Open the contributing guide

Research direction

Reproduce the error after a fresh install of versions v1.2.2, v1.2.1, or v1.1.0, then inspect BaseCollectionHelper.js at line 29 and the PropTypes usage shown in the report. Done means the collection helper loads without the oneOfType runtime error and its existing prop-type declarations work as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.