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

babelPluginFlowReactPropTypes_proptype_Element is not defined

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

Description

Source (mimicing [result of `findDOMNode()`](https://github.com/facebook/flow/blob/v0.49.1/lib/react.js#L244)):

```js
/**
* return type of ReactDOM.findDOMNode()
*
* NOTE: `Element` is NOT the same as `type { Element } from 'react'` a.k.a React$Element
*
* To use it as a typical node, check with `if (node instanceof HTMLElement) { ... }`
*/
export type DOMNode = Element | Text | null;
```

Usage is causing:

```
types.js:15 Uncaught ReferenceError: babelPluginFlowReactPropTypes_proptype_Element is not defined
at Object.defineProperty.value (types.js:15)
at __webpack_require__ (bootstrap 67889448ccd6ec73efec:49)
at Object. (Transition.js:67)
at __webpack_require__ (bootstrap 67889448ccd6ec73efec:49)
at Object.defineProperty.value (Fade.js:45)
at __webpack_require__ (bootstrap 67889448ccd6ec73efec:49)
at Object.defineProperty.value (Modal.js:90)
at __webpack_require__ (bootstrap 67889448ccd6ec73efec:49)
at Object.defineProperty.value (Dialog.js:36)
at __webpack_require__ (bootstrap 67889448ccd6ec73efec:49)
```

/see https://github.com/callemall/material-ui/issues/7400

Does use of the DOM `Element` require an explicit `import type` for compatibility with this plugin?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.