How to use package built from cloned repo in React TypeScript #356
-
Hey @mliebelt
How can I use this in React... ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Well, I am not an expert, how to program and build in React, so here is a little bit some speculation (and if you would share your possible open source repository, I could look at the current state and explain, how that could be changed). I have a similar (smaller) problem currently with Chessground, and solved it like that:
So if you have a build that is working, you could the following
I hope I could make my idea clear (enough), so you have a starting point. |
Beta Was this translation helpful? Give feedback.
-
Hey @mliebelt , Came across an import issue when working in react-typescript projects. I may be wrong in the way I've used/imported... When I went through the code, there's a param to pass to The component fails to mount. This Issue only occurs in React-Typescript, the package runs as expected in React-JSX. |
Beta Was this translation helpful? Give feedback.
-
Is this a possible fix...? In
And, In |
Beta Was this translation helpful? Give feedback.
-
Please have a look at my commit 924ce... which does the following:
By doing that, you should be able to use the 4 base functions as showed in your screenshot above. I do not know if that fixes all problems, but at least the import should be possible. |
Beta Was this translation helpful? Give feedback.
-
I did a new release of pgn-viewer today (1.6.0), with breaking changes. Now the import should work as expected, the types are available, and I was able to create the example react component from above without any tricks. @coffeeDev98 Could you check if that new version is working for you out-of-the-box? If you want to use your fork, you have to merge my changes into your repository. |
Beta Was this translation helpful? Give feedback.
I did a new release of pgn-viewer today (1.6.0), with breaking changes. Now the import should work as expected, the types are available, and I was able to create the example react component from above without any tricks.
@coffeeDev98 Could you check if that new version is working for you out-of-the-box? If you want to use your fork, you have to merge my changes into your repository.