Best way to use the library with Typescript #1868
-
Hi guys! I am learning TypeScript and RNUILib, and I was wondering if I am approaching something in a good way. For example, I want to wrap a Here is my hypothetical example:
What concerns me is importing the type like so:
Which implies that I have to know how the library is structured inside. I would much rather prefer it to be like so:
P.S.
But would it not defeat the purpose of importing only the components I need?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @dpoltoratsky As you suggested, we should support importing the If you feel comfortable with the code, consider submitting a PR with a suggestion, I'd love to assist. |
Beta Was this translation helpful? Give feedback.
Hi @dpoltoratsky
You concern is definitely justified.
The structure of this path
"react-native-ui-lib/generatedTypes/src/components/button"
is something that probably will change in the future and might break you.As you suggested, we should support importing the
ButtonProps
from the Button package or any other solution.If you feel comfortable with the code, consider submitting a PR with a suggestion, I'd love to assist.