milesj / babel-plugin-typescript-to-proptypes

Generate React PropTypes from TypeScript interfaces or type aliases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Breaks existing prop-types deconstruction for jest tests

drewdrewthis opened this issue · comments

Code

import {
  number,
  string,
  oneOfType,
  arrayOf,
  node,
  bool,
  func,
  shape,
  InferProps
} from 'prop-types'

....


export const propTypes = {
  id: string,
  placeholder: string,
  disabled: bool,
  className: string,

OUTPUT:

● Test suite failed to run

    ReferenceError: string is not defined

      29 |
      30 | export const propTypes = {
    > 31 |   id: string,
         |       ^
      32 |   placeholder: string,
      33 |   disabled: bool,
      34 |   className: string,

Is fixed in the latest version.