brigand / brigand/babel-plugin-flow-react-proptypes

Fails to check "Objects as maps"

Open
#207 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
427
Forks
42
PR merge metrics
No merged PRs in 30d

Description

My code:

```js
export type ContextTypes = {
query: { [string]: string },
};
```

It is built fine, but when I run on a browser, the error log below appears:

```
Warning: Failed prop type: propValue.hasOwnProperty is not a function
```

Reference: [Objects as maps in Flow Types](https://flow.org/en/docs/types/objects/#toc-objects-as-maps)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the browser warning with the reported ContextTypes declaration and compare the plugin's generated PropTypes behavior for Flow's "Objects as maps" syntax. Use the linked Flow documentation as the type reference; done means this declaration builds and runs without the reported prop-type warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.