Issue 1:
I tried using the @types/xxxx package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @Igorbek @Igmat @Lavoaster

TS v3.4.3

styled-components v4.2.0

@types/styled-components v4.1.9 and above

In every version since v4.1.9 I get a lot of errors about @types/react-native/global.d.ts on build - I've copied a few of these below.

I'm using styled-components in a React web project. From digging around I think that these conflicts are caused by react-native declaring types globally that conflict with types in node/the dom.

ERROR in [at-loader] ./node_modules/@types/react-native/globals.d.ts:210:5
TS2717: Subsequent property declarations must have the same type. Property 'onloadstart' must be of type '((this: XMLHttpRequest, ev: ProgressEvent) => any) | null', but here has type '((this: XMLHttpRequest, ev: Event) => any) | null'.

ERROR in [at-loader] ./node_modules/@types/react-native/globals.d.ts:211:5
TS2717: Subsequent property declarations must have the same type. Property 'onprogress' must be of type '((this: XMLHttpRequest, ev: ProgressEvent) => any) | null', but here has type '((this: XMLHttpRequest, ev: Event) => any) | null'.

ERROR in [at-loader] ./node_modules/@types/react-native/globals.d.ts:212:5
TS2717: Subsequent property declarations must have the same type. Property 'ontimeout' must be of type '((this: XMLHttpRequest, ev: ProgressEvent) => any) | null', but here has type '((this: XMLHttpRequest, ev: Event) => any) | null'.

ERROR in [at-loader] ./node_modules/@types/react-native/globals.d.ts:243:6
TS2300: Duplicate identifier 'XMLHttpRequestResponseType'.

ERROR in [at-loader] ./node_modules/@types/react-native/index.d.ts:9542:18
TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.

ERROR in [at-loader] ./node_modules/@types/react-native/index.d.ts:9545:11
TS2451: Cannot redeclare block-scoped variable 'navigator'.

With version 4.1.8 of @types/styled-components, I don't get these errors.

I noticed from 4.1.8 -> 4.1.9 package.json incuded @types/react-native in dependencies and this is very likely related, I'd assume.

v4.1.8

"dependencies": {
"@types/node": "*",
"@types/react": "*",
"csstype": "^2.2.0"
},

v4.1.9

"dependencies": {
"@types/react": "*",
"@types/react-native": "*",
"csstype": "^2.2.0"
},

I guess I'm fine just sticking on 4.1.8 but just curious as to what the cause of this is? Do I need to change my own typescript config in some way to tell it not to include transitive dependencies on react-native?

Issue 2:
TLDR;: This issue is intended to raise a discussion regarding possible reorganisation of the React Native type definitions.

All the following is mainly written for @alloy, however it's open for all for the discussion.

Intro

After spending some time contributing to the React Native definitions I found myself thinking about following big changes that might benefit them. If we can come up to the agreement regarding some of this suggestions we can then split work into chunks and do it together. In other words let's introduce it as small PRs (one component at a time) rather then one huge.

Remove docs comments

Currently most of the properties/functions definitions are accompanied with docs. As we know comments always get stale. And even though it might be useful to give a person nice description of what property is about on hover, it would be better to not show description at all then show the wrong one.

Since this repository is a peer effort on types it's harder to keep track if docs has changed or not especially when the release schedule for the library is every month. If for code people come to change something because it doesn't work anymore, I guess nobody or almost nobody comes here to change docs.

As for my experience I always check official docs to make sure that I will get up to date correct information, which makes comments in the definitions even more useless.

Remove platform specific properties

Currently there are platform specific properties defined for each component which then got merged together with "common" properties using extension mechanism.

First of all sometimes it seems to be impossible to split type definitions. For example for union types. It means that we either duplicate definitions for iOS with all described alternatives or put them under "common" properties. In first case it may lead to errors when type is updated in one place, but not updated in another. In second case it means that we can't clearly separate platform specific definitions.

Also sometimes React Native adds support for both platforms, so some property should be moved form platform specific type to "common" type. But since everything work even without it, most of the time it doesn't happen.

I might be wrong, but I see no explicit value for consumers of type definitions in having platform specific properties types. Am I missing something?

Rearrange fields in properties in accordance to docs

It would be much easier to update types for components if order of fields in will follow React Native official documentation. There is no way to enforce it, but we can at least make it so. And I guess it would quite easy for future contributors to spot this pattern and follow it.