soywod / react-pin-field

📟 React component for entering PIN codes.
https://soywod.github.io/react-pin-field/
MIT License
413 stars 24 forks source link

Error: Jest can't compile when react-pin-field is called in component #20

Closed pedroSoaresll closed 4 years ago

pedroSoaresll commented 4 years ago

Hello @soywod

I was using react-pin-field together @caiomdias but when we running Jest to test our components, we receive an error.

jest error unexpected token import

I did a fork of this repo and change the module inside tsconfig.json to CommonJS, so all working. I think that other people could have this problem too, I don't know if have other solution for this but, if you want I can do a pull request with this change.

At this moment we are using another repository to solve Pin Inputs, but we really would like to use yours.

I tried the recommendations about this issue #18 but nothing worked.

PR: #21

soywod commented 4 years ago

You right, it should definitely be CommonJS, I will change it soon. Did you check this issue? It could fix meanwhile.

pedroSoaresll commented 4 years ago

@soywod thanks for your fast answer. And yes, I did the recommendations about issue #18 but nothing worked.

pedroSoaresll commented 4 years ago

You right, it should definitely be CommonJS, I will change it soon. Did you check this issue? It could fix meanwhile.

I can open the PR and we can look at it together

pedroSoaresll commented 4 years ago

@soywod PR: #21

pedroSoaresll commented 4 years ago

Closing this issue. PR was merged. Thank you @soywod

soywod commented 4 years ago

Just released v1.0.4, let me know if it fixes well your problem! Thank you for your feedback!

pedroSoaresll commented 4 years ago

Just released v1.0.4, let me know if it fixes well your problem! Thank you for your feedback!

Hey @soywod, all working fine! Thank you!