Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proptypes changes impacted inferno-compat #8

Open
AlgoTrader opened this issue Mar 25, 2017 · 2 comments
Open

proptypes changes impacted inferno-compat #8

AlgoTrader opened this issue Mar 25, 2017 · 2 comments

Comments

@AlgoTrader
Copy link

inferno-compat expects proptypes to export proptypes.default. Can you please export both directly and using default property?

> require('proptypes').default
undefined

> require('proptypes')
{ array: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  bool: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  func: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  number: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  object: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  string: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  symbol: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  any: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  arrayOf: [Function: createArrayOfTypeChecker],
  element: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  instanceOf: [Function: createInstanceTypeChecker],
  node: { [Function: bound checkType] isRequired: [Function: bound checkType] },
  objectOf: [Function: createObjectOfTypeChecker],
  oneOf: [Function: createEnumTypeChecker],
  oneOfType: [Function: createUnionTypeChecker],
  shape: [Function: createShapeTypeChecker] }
@developit
Copy link
Owner

developit commented Mar 25, 2017

This is a CommonJS module though - default is not something you should ever expect to be supported in a CommonJS module.

Isn't there a mode for TypeScript that automatically handles this?

Alternatively, I'd be happy to add a modules entrypoint that points to src/index.js. It seems like that would solve the issue you're seeing.

@sapegin
Copy link
Contributor

sapegin commented Jul 26, 2017

Now it’s the opposite:

> require('proptypes')
{ __esModule: true,
  default:
   { array: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     bool: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     func: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     number: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     object: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     string: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     symbol: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     any: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     arrayOf: [Function: createArrayOfTypeChecker],
     element: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     instanceOf: [Function: createInstanceTypeChecker],
     node: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     objectOf: [Function: createObjectOfTypeChecker],
     oneOf: [Function: createEnumTypeChecker],
     oneOfType: [Function: createUnionTypeChecker],
     shape: [Function: createShapeTypeChecker] } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants