Closed
Conversation
* Add _root reference items to classes * Update names of imported ReactNative Props to match renaming in RN 0.55 typescript definitions. * Update all "Function" types to define the signature of the expected function. * Where possible, extend props from their RN type (e.g. if the propTypes spread from 'ReactNative.ViewProps', extend the interface from ReactNative.ViewProps). This means that future updates to the upstream props are automatically available for use in components that spread their incoming props into the upstream type. * Where possible, use defined upstream types directly instead of copying their fields.
Contributor
|
@dawnmist got this error after running |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The Typescript definitions had several cases where they were significantly out of date.
_rootreferences, so these were unusable in Typescript.I have done my best to review the exported native-base and update the Typescript definitions to match the current native-base master branch. In doing so, I also found one component (Switch) that was spreading it's own propTypes into its propTypes definition instead of the ReactNative Switch's propTypes - a minor patch for that is included.
In order to test the Typescript definitions, I made a clone of the NativeBase-KitchenSync CRNA branch and converted that from Javascript to Typescript, to ensure that the expected functionality was all available and actually worked on the device. That branch is available here.
This also depends on the update to Typescript definitions in react-native-easy-grid, which adds the _root refs to the Grid, Row and Col components. The native-base types in this pull request now simply re-export the react-native-easy-grid ones instead of redefining them. They will still function as they currently do without that pull request - but the _root refs for Grid, Row and Col components will not be available until that pull request is also merged.